I have this working script to show chart values:
var data = google.visualization.arrayToDataTable([
['Time', 'Total MacID'],
['15', 450],
['16', 520],
['17', 130],
['18', 220],
['19', 350],
['20', 640],
['21', 125],
['22', 260],
['23', 423]
]);
I am trying to get values from php, like (this is showing blank chart):
var data = google.visualization.arrayToDataTable([
['Time', 'Total MacID']<?php echo $tablerow; ?>
]);
Value of $tablerow is
, ['0', 207], ['1', 202], ['2', 210], ['3', 198], ['4', 219], ['5', 216], ['6', 203], ['7', 198], ['8', 245], ['9', 562], ['10', 674], ['11', 823], ['12', 797], ['13', 485], ['14', 589], ['15', 693], ['16', 751], ['17', 749], ['18', 388], ['19', 301], ['20', 281], ['21', 286], ['22', 282], ['23', 257]
You can use below code
var data = new google.visualization.DataTable();
data.addColumn('string', 'Time');
data.addColumn('number', 'Total MacID');
data.addRows('15', 450);
to data.addRows use php for condition and add element.
if you are getting data from .json file then you have to parse it. Something like below code
var newData=JSON.parse(jsonData);
Let me know if it is useful to you or not.