O'Reilly logo

Learning jqPlot by Scott Gottreu

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a pie chart with empty wedges

With that out of the way, we move on to the pie chart showing revenue by division. There are only three data points, so it won't be as crammed. We use a different data source this time. We can see the results of the JSON feed in the following code:

{
  "Nerd Corral": {
    "Service": 103405.96,
    "Parts": 47002.71
  },
  "Media & Software": {
    "Music CDs": 97045.54,
    "DVDs/Blu-ray": 83181.89,
    "Digital Media": 53375.05,
    "Software": 43670.49
  },
  "Electronics": {
    "Computers": 134764.98,
    "Game Consoles": 85518.01,
    "TVs": 76345.37,
    "Media Streamers": 35632.50,
    "DVD/Blu-ray Players": 21379.50
  }
}
  1. With this chart, we create a function to parse the JSON feed and break up the functionality into several functions. Our data renderer ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required