Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
datapie = [ {"label": "Running", "data": [19.5], "color":"#e1ab0b"}, {"label": "Stopped", "data": [4.5], "color":"#fe0000"}, {"label": "Terminated", "data": [36.6], "color":'#93b40f"} ];
收到错误 TypeError: d is undefined
请帮忙!!
使用ajax调用数据
数据看起来格式不正确。它应该如下所示:
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/