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

Changing the background color of our chart

We start with the line chart showing profit and revenue because it is the simplest. We open our previous chart, 1168_01_06.html, and save it as a new file. We now have a remote data source with the revenue and profit numbers. We check the URL and find an object for both revenue and profit. Each object contains an array of arrays with the date as the x value and the dollar amount as the y value, as shown in the following code snippet:

{
  "Revenue": [
    ["2011-11-20", 800538], 
   ...
  ],
  "Profit": [
    ["2011-11-20", 192049.56], 
     ...
  ]
}
  1. We start by adding the functions.js script so that we can use remoteDataCallback to pull the revenue and profit numbers. We create our dataPull function and return the revenue and ...

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