2013-05-10 49 views
1
datapie = [ 
{"label": "Running", "data": [19.5], "color":"#e1ab0b"}, 
{"label": "Stopped", "data": [4.5], "color":"#fe0000"}, 
{"label": "Terminated", "data": [36.6], "color":'#93b40f"} 
]; 

得到一個錯誤 類型錯誤:d未定義JSON數據解析錯誤海軍報圖

請幫助!

數據使用AJAX

+0

如果你表現出你是如何調用海軍報(這將是有益的,即什麼樣的選擇,與實際'$。情節'位) – Ryley 2013-05-10 15:17:46

回答

1

的數據不看是正確的格式調用。它應該是這樣的:

datapie = [ 
{label: "Running", data: 19.5, color: '#e1ab0b'}, 
{label: "Stopped", data: 4.5, color: '#fe0000'}, 
{label: "Terminated", data: 36.6, color: '#93b40f'} 
]; 

教程 - http://digitalunion.osu.edu/2011/12/21/make-graphs-and-charts-with-jquery-using-flot-js-%E2%80%94-a-brief-tutorial/

小提琴 - http://jsfiddle.net/Rnusy/5/

+0

接受答案,如果解決了你的問題。謝謝! – Blake 2013-05-11 11:10:08