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

Getting an error TypeError: d is undefined

Please help!!

data is called using ajax

1
  • It would be helpful if you showed how you're calling flot (i.e. what options, and the actual $.plot bit) Commented May 10, 2013 at 15:17

1 Answer 1

1

The data doesn't look to be in the correct format. It should look like this:

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

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

Fiddle - http://jsfiddle.net/Rnusy/5/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.