Book Image

Learning jqPlot

By : Scott Gottreu
Book Image

Learning jqPlot

By: Scott Gottreu

Overview of this book

Table of Contents (19 chapters)
Learning jqPlot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 5, Pie Charts and Donut Charts


  1. We passed an array of color values to seriesColors to override the default colors in jqPlot.

  2. We can set dataLabelNudge under rendererOptions for a series to move the labels further from the center of the pie.

  3. If we do not set a value for dataLabels, the label will default to showing the percentage of the wedge. The other two options are label, which is the value passed in as the x value, and value, which is the number passed in as the y value.

  4. We set numberRows to 1 under rendererOptions for our legend.

  5. 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.

  6. When a user clicks on a wedge showing browser usage, it can load a second pie chart showing the versions.

  7. 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 set seriesColors to match the divisional colors used in the three pie charts.