我想使用谷歌图形API以类似
的方式绘制折线图 I have 24 values mean (1 day = 24 hours) in x-axis from 0 to 23
And i have 3 column in y-axis today , yesterday and week.
所以我想在今天,昨天和每周的一小时显示12个值的值。
例如我有6个小时,然后最多36个值应该在y轴上显示.12每个今天,每周和昨天。
如何使用以下代码执行此操作。
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Year', 'Sales', 'Expenses'],
['2004', 1000, 400],
['2004', 1011, 420],
['2004', 1004, 430],
['2005', 1170, 460],
['2006', 660, 1120],
['2007', 1030, 540]
]);
var options = {
title: 'Company Performance' ,
hAxis: { minValue: 0, maxValue: 15},
vAxis: { minValue: 0, maxValue: 15},
legend: 'none'
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<div id="chart_div" style="width: 680px; height: 285px;margin-top: 10px;margin-left: 10px;"></div>
</body>
</html>
由于