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], ... ] }
We start by adding the
functions.js
script so that we can useremoteDataCallback
to pull the revenue and profit numbers. We create ourdataPull
function and return therevenue
andprofit
arrays wrapped in another array as follows:<script src="../js/jqplot.dateAxisRenderer.min.js"></script> <script src="../js/functions.js"></script> <script> $(document).ready(function(){ ...