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 candlestick chart with filtered data

We are happy with how our OHLC chart turned out. Now, we turn our attention to creating a candlestick chart. We consider this might work well on the dashboard.

We open the OHLC chart we just created and save it as a new file. We only need to set one option to make it a candlestick chart, but we also want to make a few other cosmetic changes. We execute the following steps:

  1. The first change is the data feed that will pull in the stock prices of the last 14 days. We also update our title:
    ...
      var stockPrice = $.jqplot ('stockPrice', "./data/last_14.json",
      {
        title:'Last 14 Days - jQ Big Box Electronics (jqBBE)',
  2. Under rendererOptions for our series, we set candleStick to true:
    ... series: [ { renderer:$.jqplot.OHLCRenderer, ...

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