I have an array and a second column with values โโsimilar to this 2050.878456 , and inside my javascript function to create an Area Chart I did the following
function drawVisualization() { var data = null; data = new google.visualization.DataTable(); data.addColumn('string', 'Date'); data.addColumn('number', 'Value'); data.addRows(myArrayCreated); // Create and draw the visualization. var ac = new google.visualization.AreaChart(document .getElementById('visualization_chart')); ac.draw(data, { title : 'Results', isStacked : true, width : 700, height : 400, vAxis : {title : "kW"}, hAxis : {title : "Day"} }); }
however, I get this Type mismatch. Value 2050.878456 does not match type number in column index 1 error Type mismatch. Value 2050.878456 does not match type number in column index 1 Type mismatch. Value 2050.878456 does not match type number in column index 1 , but it also cannot be a string type, why can I get this error and how to fix it?
source share