I have 1 data table consisting of 2 data sets, but could be more. Typically the data is :-
var ar = [[["09:17:39",-23.4],["09:17:59",-23.4],["09:18:19",-23.4]],[["00:00:44",12.8],["00:01:05",12.8],["00:01:26",12.8]]].
The simple data set has 2 columns time
& value
.
The code that I have is :-
var ar = <?php echo json_encode($TopArray, JSON_NUMERIC_CHECK) ?>;
var data = new google.visualization.DataTable();
data.addColumn('string', 'Time');
data.addColumn('number', 'value');
data.addRows(ar);
var options = {'title' : 'Something',
hAxis: {title: 'Time'},
vAxis: {title: 'Value'},
'width': 1200,
'height': 600,
};
var chart = new
google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
What is wrong with this code ? If someone can help it would be gratefully appreciated - Thanks