0
我有這方面的工作腳本來顯示圖表值:使用PHP回聲
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]
]);
我試圖從PHP得到的值,比如(這是顯示空白圖表):
var data = google.visualization.arrayToDataTable([
['Time', 'Total MacID']<?php echo $tablerow; ?>
]);
價值$ tablerow的是
,[ '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] ,[ '20',281], [ '21',286],[ '22',282],[ '23',257]
使用'json_encode'和'json_decode' – Rayon