-
Book Overview & Buying
-
Table Of Contents
Learning jqPlot
By :
Calvin stops by while we're taking a break. "Hey guys, I had a VP call and they want to see revenue broken down by division. Can we do that?" We tell him we can. "Great" he says, before turning away and leaving. We discuss this new request and realize this would be a great chance to use a stacked area chart.
We dig around and find the divisional revenue numbers Calvin wanted. We can reuse the chart we just created and just change out the data and some options.
We use the same variable names for our divisional data and plug in revenue numbers instead of profit. We use a new variable name for our chart object and a new id attribute for our div. We update our title and add the stackSeries option and set it to true:
var div_revenue = $.jqplot ('division_revenue', [electronics, media, nerd_corral], { title:'12 Month Divisional Revenue', stackSeries: true,
We leave our series' options alone and the only option we change on our x axis is set numberTicks...
Change the font size
Change margin width
Change background colour