I'm creating a pie chart using Google Charts, and I get this error:
Uncaught Error: Type mismatch. Value 720 does not match type date in column index 1
My code is the following:
var graphData = [
[
'Occupation',
{type: 'number'},
{type: 'string', role: 'tooltip', 'p': {'html': true}}
],
['Training', 720, '<div class="pie-tooltip">Training<br/><strong>12 hours </strong></div>']
];
var data = google.visualization.arrayToDataTable(graphData);
var options = {
is3D: true,
};
var chart = new google.visualization.PieChart(document.getElementById('field-occupation-graph'));
chart.draw(data, options);
The {type: string}
after Occupation
is something I changed to avoid the same error. I had the value 'Time'
in there, and the error, instead of saying 720
said Time
. Basically the same error but with the headers of the chart.
I don't know from where comes this error of type date
, this chart is not using dates at all.
I'm clueless here, so any help would be very much appreciated. Thanks!