ContentsBasic ChartingPlace a chart legend
Previous: Axis labels | Next: Charting

Place a chart legend

Placing a legend involves some experimentation and taste. It is done simply by an invocation of the PdfPage.drawLegend() method. The parameters are fairly self-explanatory, but the location, size, and color are bound to need a little tweaking. code / output

Legends are interesting and important when more information is represented on the chart. As we wrap up this section of the tutorial, let's place a few more value sets. code / output

We've made a number of changes that need explanation:

For a final round of changes before we move on to more advanced topics, we add a bar value set and replace the noisyWave line representation with a BurstGlyphValueSet. code / output

A few things to take note of in this sample:

That pretty well completes the basics of regular chart creation with the Servlet Utilities. Next, I'll explain how to extend ValueSet for those cases where the provided ValueSets won't work.


ContentsBasic ChartingPlace a chart legend
Previous: Axis labels | Next: Charting