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

Dynamically building our chart when the page loads

We start thinking about the bar chart we made that showed various product categories and a trend line for a chosen category. We send off another e-mail to IT to see whether they can compile the data into a JSON feed. A few minutes later, we get a reply stating that Roshan has asked for the same thing. They are still trying to get everything working, but in the interim, they created a mock JSON feed. They also sent along the URL.

We load the JSON feed in our browser. They moved all the category data into an object called categories. They also created an object called labels to hold the ticks for our chart:

{ "categories": { "TVs": [378583.39, 346552.99, 368164.98, 371856.60, 366457.82, 327396.58], ...

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