I have LineGraph using googlechart. This graph is created with the following code
function drawChart() {
var data = google.visualization.arrayToDataTable([
['Categegories', 'R1' , 'R2' , 'R3' , 'R4' , 'R5' , 'R6' ],
['A', 1, 4, 2, 4, 1, null],
['D', 3, null, null, 7, null, 1],
['G', null, null, null, 8, null, null],
]);
var options = {
title: 'Graph',
pointSize: 6,
vAxis: {minValue:0, maxValue:10,gridlines:{count:6}},
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
Now surprisingly if I remove a data row ['D', 3, null, null, 7, null, 1],
It produces an error saying that All series on a given axis must be of the same data type
I have reduce my code to just one line and I found that there is problem with null
values
e.g.
['Category', 'R1' , 'R2' , 'R3' ],
['A', 2, 1, 1]
It generates the graph while if I add null
value any where in the data i.e in the place of (2,1,1) it does not..
Waiting for some expert guidance about setting some kind option for handling null
values... It is very strange that some time null values works and some time not.. :(