I'm struggling with an error message that appears when I try to run my Google chart. Here is the code I am using to generate the chart.
function (resultVal) {
var arrMain = new Array();//[];
for (var i = 0; i < resultVal.length; i++) {
var arr = new Array(resultVal[i].ScaleMin, resultVal[i].CountryNo, resultVal[i].ScaleMax, resultVal[i].Currency);
arrMain.push(arr);
}
var data = new google.visualization.DataTable();
data.addColumn({ type: 'number', id: 'ScaleMin', label: 'ScaleMin' });
data.addColumn({ type: 'number', id: 'CountryNo', label: 'CountryNo' });
data.addColumn({ type: 'number', id: 'ScaleMax', label: 'ScaleMax' });
data.addColumn({ type: 'string', id: 'Currency', label: 'Currency' });
data.addRows(arrMain);
var options = {
'title': 'Salad Entry',
'width': 800,
'height': 600
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
google.visualization.events.addListener(chart, 'ready', function () {
chart_div.innerHTML = '<img src="' + chart.getImageURI() + '">';
$.ajax({
url: "SaladEntry/SaveToLocal",
type: "POST",
data: { 'jsonData': chart.getImageURI() },
success: function (ret) {
alert(ret);
}
});
});
chart.draw(data, options);
Upon loading the chart, I encountered this error message:
https://i.sstatic.net/pEJq9.png
Additionally, here is the array I have set as the datasource of my chart: