I want to create a Column Chart , using Google Visualization API , I can send the data to populate the chart\'s DataTable in array form. But I need to generate the chart with va
You can put the data in one string and use JSON.parse(stringData). The year column must be in double quotes
var data = new google.visualization.DataTable();
data.addColumn('string', 'Year');
data.addColumn('number', 'Sales');
data.addColumn('number', 'Expenses');
var stringData = '[["2004", 1000 , 400], ["2005", 1170, 460], ["2006", 660, 1120], ["2007",1030,540]]';
data.addRows(JSON.parse(stringData));