We passed an array of color values to
seriesColors
to override the default colors in jqPlot.We can set
dataLabelNudge
underrendererOptions
for a series to move the labels further from the center of the pie.If we do not set a value for
dataLabels
, the label will default to showing the percentage of the wedge. The other two options arelabel
, which is the value passed in as the x value, andvalue
, which is the number passed in as the y value.We set
numberRows
to1
underrendererOptions
for our legend.If there are a lot of small wedges, it will be hard to tell what category they belong to or compare them to other categories. Also, you cannot determine trends from a pie chart.
When a user clicks on a wedge showing browser usage, it can load a second pie chart showing the versions.
We will start by looping through each division and storing the data in a temporary array. We will then sort the data and add it to the data array getting returned from our
dataPull
function. We will also setseriesColors
to match the divisional colors used in the three pie charts.
Learning jqPlot
By :
Learning jqPlot
By:
Overview of this book
Table of Contents (19 chapters)
Learning jqPlot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Free Chapter
Getting Started
More Line Charts, Area Charts, and Scatter Plots
Bar Charts and Digging into Data
Horizontal and Stacked Bar Charts
Pie Charts and Donut Charts
Spice Up Your Charts with Animation, Tooltips, and Highlighting
Stock Market Charts – OHLC and Candlestick Charts
Bubble Charts, Block Plots, and Waterfalls
Showing Real-time Data with Our Charts
Beautifying and Extending Your Charts
Bringing it All Together
Answers
Index
Customer Reviews