运行 ❯
获取您自己的
网站
×
更改方向
保存代码
更改主题,暗/亮
前往 Spaces
<!DOCTYPE html> <html> <script src="https://www.gstatic.com/charts/loader.js"></script> <body> <div id="myChart" style="width:100%; max-width:600px; height:500px;"></div> <script> google.charts.load('current',{packages:['corechart']}); google.charts.setOnLoadCallback(drawChart); function drawChart() { // Set Data const data = google.visualization.arrayToDataTable([ ['Price', 'Size'], [50,7],[60,8],[70,8],[80,9],[90,9], [100,9],[110,10],[120,11], [130,14],[140,14],[150,15] ]); // Set Options const options = { title: 'House Prices vs. Size', hAxis: {title: 'Square Meters'}, vAxis: {title: 'Price in Millions'}, legend: 'none' }; // Draw const chart = new google.visualization.ScatterChart(document.getElementById('myChart')); chart.draw(data, options); } </script> </body> </html>