javascript - All series on a given axis must be of the same data type for line chart -
i'm working on line chart using google js
, have given sample values testing , i'm getting error
all series on given axis must of same data type
script
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>
works fine 2 columns...
data.addcolumn('string', 'year'); data.addcolumn('number', 'quantity'); data.addrows([ ['2008',36], ['2009',27], ['2010',39] ]);
Comments
Post a Comment