ContentsChartingCommon ValueSet types
Previous: Altering the underlying data | Next: Coding a new ValueSet type

Common ValueSet types

Although all of the examples so far have used subclasses of ValueSet, this is not a strict requirement. PdfChart.appendValues() can reference any object which implements the Renderable interface. For a large category of values, though, the subclasses of ValueSet provide a handy some handy prebuilt functionality.

You've already used each of these classes in the examples, but here's a list:

LineValueSet

Simple connected vertices

AreaValueSet

Connected vertices with an area fill below, reaching to the bottom of the chart

GlyphValueSet

Vertices with symbols (glyphs) at each data point, and the option to connect the vertices

BurstGlyphValueSet

Specialization of GlyphDataSet, providing a simple API for parametric generation of star burst glyphs

BarValueSet

Rectangular bars of defined width and offset, allowing the option of being stacked on top of other bars

The only ValueSet that may need more clarification is the BarValueSet. Here's an example that demonstrates that feature. code / output

I should explain what's going on at line 56. A range (from point 10 to point 30) of the value array has been forced to a value of 0.5 in order to illustrate that changes can be made to the array prior to rendering via PdfChart.drawMain(). Changes made afterwards have no effect. For this reason, the top chart has the randomness of the original values which came from generateNoise() whereas the lower chart has a flat spot because the randomness was removed for a limited range ov values.


ContentsChartingCommon ValueSet types
Previous: Altering the underlying data | Next: Coding a new ValueSet type