-
Book Overview & Buying
-
Table Of Contents
Learning jqPlot
By :
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:
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]]],
...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...
Change the font size
Change margin width
Change background colour