Using Datasets and Renderers

Datasets are used to apply different rendering settings to different sets of measures in a chart. Each dataset can use its own axis configuration.

CFG datasets
Figure 1. Two metrics styled with two different datasets in the same chart
<chart type="TE" id="DATASETS_EXAMPLE">
<dataset renderer="LINE" rangeAxisId="AXIS_RAW">
	<measure color="BLUE" alpha="200" label="Source Line of Code">SLOC
		<forecast>
			<version value="7777" timeValue="DATE(2014,08,01)" label="V3" />
		</forecast>
	</measure>
</dataset>

<dataset renderer="BAR" rangeAxisId="AXIS_KLOC">
	<measure color="ORANGE" alpha="200" label="Line of Code">LC
		<forecast>
			<version value="9999" timeValue="DATE(2014,08,01)" label="V3" />
		</forecast>
	</measure>
</dataset>

<rangeAxis id="AXIS_RAW" label="LC" color="BLUE" />
<rangeAxis id="AXIS_KLOC" label="SLOC (KLOC)" color="ORANGE" />
</chart>

There are 7 basic types of renderers. Each one has can be prefixed with the STACKED_ modifier to stack data series on top of each other, and suffixed with the _100 modifier that displays data series as percentages:

BAR

CFG renderer bar
Figure 2. BAR
CFG renderer stacked bar
Figure 3. STACKED_BAR
CFG renderer stacked bar 100
Figure 4. STACKED_BAR_100

LINE

CFG renderer line
Figure 5. LINE
CFG renderer stacked line
Figure 6. STACKED_LINE
CFG renderer stacked line 100
Figure 7. STACKED_LINE_100

STEP

CFG renderer step
Figure 8. STEP
CFG renderer stacked step
Figure 9. STACKED_STEP
CFG renderer stacked step 100
Figure 10. STACKED_STEP_100

SPLINE

CFG renderer spline
Figure 11. SPLINE
CFG renderer stacked spline
Figure 12. STACKED_SPLINE
CFG renderer stacked spline 100
Figure 13. STACKED_SPLINE_100

AREA

CFG renderer area
Figure 14. AREA
CFG renderer stacked area
Figure 15. STACKED_AREA
CFG renderer stacked area 100
Figure 16. STACKED_AREA_100

AREA_STEP

CFG renderer area step
Figure 17. AREA_STEP
CFG renderer stacked area step
Figure 18. STACKED_AREA_STEP
CFG renderer stacked area step 100
Figure 19. STACKED_AREA_STEP_100

AREA_SPLINE

CFG renderer area spline
Figure 20. AREA_SPLINE
CFG renderer stacked area spline
Figure 21. STACKED_AREA_SPLINE
CFG renderer stacked area spline 100
Figure 22. STACKED_AREA_SPLINE_100

The dataset element accepts the following attributes:

  • renderer (optional, default: differs according to the type of chart) allows specifying the type of rendering for the data series

  • rangeAxisId (optional) allows providing a reference to an axis configuration element

Chart axes can be defined using the rangeAxis element, which accepts the following attributes:

  • id (mandatory) The configuration identifier (referred to by a dataset element)

  • label (optional, default: the measure name) The label to be displayed on the axis

  • min (optional, defaults to an automatic value) is the minimum boundary for the axis. This attribute can be specified as a value or as a computation.

  • max (optional, defaults to an automatic value) is the maximum boundary for the axis. This attribute can be specified as a value or as a computation.

  • visible (optional, default: true) allows hiding a vertical axis when set to false

  • hideTickLabels (optional, default: false) allows hiding values on vertical axes when set to true

  • inverted (optional, default: false) reverses the order of values on the axis when set to true.

  • location (optional, default: left for vertical charts, bottom for horizontal charts) allows defining where around the chart the axis is drawn. Allowed values are: left, right, bottom and top.

  • color (optional, default: automatically assigned) sets the colour used to draw the scale.Working With Colours

  • type (optional, default: NUMBER) defines how the axis is represented. Accepted values are:

    • NUMBER to display numerical values

    • SCALE to plot the axis with the associated scale levels of an indicator (see scaleId below)

    If you are looking to display dates on your axes, simply add a milestoneHistory element to your chart, as described in Displaying milestone date changes.

  • numberFormat (optional, default: usually number) allows customising the number format when using type="number". The accepted values are as follows:

    • NUMBER to display a number (formatted according to the browser’s locale)

    • PERCENT to display a percentage

    • INTEGER to display a number with no decimals

The rangeAxis element also accepts one or more marker child elements, so you can insert markers, as described in Adding Markers. This makes the following possible:

<rangeAxis id="AXIS_COMPLETION" label="Completed tasks (%)" >
<marker fromScale="SCALE_COMPLETION" isVertical="false" />
</rangeAxis>