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

Removing axis labels and adding point labels


Since this chart will be in a confined space, we will turn off the ticks and label on the y axis to increase the amount of area in the chart. We will use the same plugins as before, but we will also include the pointLabels plugin this time:

  1. Since this is a proof-of-concept chart, we just pass in the last month's data for each data series and wrap it in an array. If Sara signs off on this, we can create a data renderer to pull last month's data dynamically:

    ...
    <script src="../js/jqplot.pointLabels.min.js"></script>
    ...
      var rev_category = $.jqplot ('rev_category', [ [dvds[11]], [cds[11]], [software[11]], [digital[11]], [tvs[11]], [computers[11]], [consoles[11]], [dvd_players[11]], [media_streamers[11]]],
    ...
  2. Next, we use the new edgeTolerance option for the pointLabels option. In the previous charts, the point labels disappeared when they got too close to the edge of the plot. Our workaround was to add padding to the y axis. With edgeTolerance...