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 an OHLC chart with last quarter's stock data

When we return to our office, we contact the IT team to get a JSON feed of the company's stock prices. They have one that was created a few months back. This gives us the stock prices of the last three quarters, which should be enough to get us started. We load the JSON feed in our browser and see that it is an array of arrays. For each array corresponding to a day, there are five elements: the date, the opening price, the high price, the low price, and the closing price:

[
["30-Sep-2012", 16.91, 17.29, 16.86, 17.16],
["29-Sep-2012", 16.70, 16.91, 16.46, 16.89],
...
]

With an understanding of the format of our remote data, we begin coding our chart using the following steps:

  1. We start by including ...

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