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

Creating a pie chart for each division with product category revenue

We decide that we will create all three divisional pie charts and place them side by side. This way, all the VPs will be able to compare each division. We do so by executing the following steps:

  1. We start by repurposing our dataPull function. This time we make use of the options object passed into the function. We pass in the name of the division in hashName, which corresponds to an object in our JSON feed:
    ...
    <script>
    function dataPull(remoteData,options) {
      var obj = remoteData[options.hashName];
      var data = new Array();
      var i = 0;
  2. We then loop through each child object in our divisional object. We build an array element for each product category with a label and the dollar value. ...

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