我使用google js
在折线图上工作,我已经提供了一些测试样本值,我收到了错误
All series on a given axis must be of the same data type
脚本
function drawChart() {
// var data = google.visualization.arrayToDataTable(chartData);
var data = new google.visualization.DataTable();
data.addColumn('number', 'Year');
data.addColumn('string', 'Value');
data.addColumn('number', 'Quantity');
data.addRows([
[2008,'Value1',36],
[2009,'Value2',27],
[2010,'Value3',39]
]);
var options = {
title: "Company Performance Product Category Wise",
pointSize: 5
};
var lineChart = new google.visualization.LineChart(document.getElementById('chart_div'));
lineChart.draw(data, options);
}
HTML
<div id="chart_div" style="width: 600px; height: 400px">
</div>
答案 0 :(得分:0)
只有两列才能正常工作......
data.addColumn('string', 'Year');
data.addColumn('number', 'Quantity');
data.addRows([
['2008',36],
['2009',27],
['2010',39]
]);