0
我想使用來自mysql的數據創建折線圖,並且生成的json看起來像這樣。如何使用來自mysql的數據創建折線圖
[{"date1":"2014-05-07","count":"1","name":"Aparna Giridhar"},{"date1":"2014-05-27","count":"1","name":"Aparna Giridhar"},{"date1":"2014-05-27","count":"2","name":"Yatish Bhargava"},{"date1":"2014-05-28","count":"3","name":"Yatish Bhargava"},{"date1":"2014-05-23","count":"2","name":"Natesh Bargi"},{"date1":"2014-05-28","count":"2","name":"Natesh Bargi"},{"date1":"2014-05-28","count":"3","name":"Divya Raghavan"},{"date1":"2014-05-30","count":"3","name":"Shreya P"},{"date1":"2014-05-07","count":"2","name":"Sharan Bains"},{"date1":"2014-05-09","count":"2","name":"Sharan Bains"},{"date1":"2014-05-16","count":"5","name":"Sharan Bains"},{"date1":"2014-05-28","count":"1","name":"Sharan Bains"},{"date1":"2014-05-30","count":"1","name":"Sharan Bains"},{"date1":"2014-05-26","count":"5","name":"Vergis Koshy"},{"date1":"2014-05-02","count":"1","name":""},{"date1":"2014-05-12","count":"2","name":""},{"date1":"2014-05-13","count":"5","name":""},{"date1":"2014-05-14","count":"1","name":""},{"date1":"2014-05-15","count":"1","name":""},{"date1":"2014-05-17","count":"1","name":""},{"date1":"2014-05-30","count":"2","name":"Deepti Karthik"}]
在我的圖x軸我想日期,y軸作爲計數和行作爲名稱。
我得到錯誤@ VAR數據= google.visualization.arrayToDataTable(OBJ);不是數組.. – ammu
你解析過JSON數據嗎? - 如果您讀取了「設置數組並返回的數據也必須表示該數組結構」的鏈接,請參閱第二個步驟 –
。 ...在服務器端構建它' –