We have one more chart to create for the VP's dashboard in the form of a bar chart showing product returns. We were able to get the data for each return category for the last 12 months in a JSON feed. We can reuse defaultBarObj
and color_theme
, which will speed up the building of our chart as follows:
We open the chart we created a few weeks ago,
1168_03_05.html
. Since all of these charts are going to be combined into one page, we need to create separate variables for our series objects and our functions to format the remote data as follows:$(document).ready(function(){ var returnsSeriesObj = []; var returnsDataPull = function(remoteData,options) { return [remoteData]; };
We pass in our new series object,
CategoryAxisRenderer
, and our newreturnsDataPull
function. Once we createreturnsPlotObj
, we setvaryBarColor
totrue
. Our first version of this chart had the same color for each bar since they are technically all in the same series. UsingvaryBarColor...