On line guide/help

You are on page 29 of the online help. Navigate sequentially through the guide pages or search for a topic of interest to you.

Index Prev. Next

Legend

Draw a chart legend

A legend on a graph is a key that identifies the different data series or categories represented in the plot. It explains what each color on the chart corresponds to, allowing you to correctly interpret the data.


Parameters

Elements / attributes of the <legend> element:

Coordinate parameters (required) that define the print area of the legend
<x1> Starting X coordinate (upper/left corner)
<y1> Starting Y coordinate (upper/left corner)
<x2> Ending X coordinate (bottom/right corner)
<y2> Ending Y coordinate (bottom/right corner)
The coordinates can also be set with <x>, <y>, <width>, <height> instead of x1, y1, x2, y2 (one of the two methods is required).
The coordinates are page coordinates (they are not relative to the chart).

Parameters that define the appearance of the graph:
<radius> Radius of the corners of the legend background (if set to zero the background is a rectangle)
<visible> Legend visibility (the old misspelled name <visibile> is also accepted). Possible values:
1, true, yes, on : legend is visible
0, false, no, off : legend is hidden
<opacity> A numeric value (float) between 0 (completely transparent) and 1 (completely opaque). For example, setting a value of 0.5 results in 50% transparency
<orientation> Layout of the legend items: H / horiz / horizontal (default) or V / vert / vertical
<title> Optional legend title
<font> Font of the title and of the labels (if not set, the default font is used)
<linestyle> Line style of the legend border and of the color boxes
<fillstyle> (or <fill>) Background fill of the legend (solid fill only)

Sizes of the legend elements, in mm (version 1.0.12 or later):
<boxsize> Size of the color box of each item (default 5)
<labelheight> Height of each item (default 6); the color box is vertically centered on the label
<titleheight> Height of the title (default 6)
<itemmargin> Space between the items of a vertical legend (default 1)
<padding> Space between the border of the legend and its contents, and between the color box and the label (default 2)

Values printed after the labels by the pie and single bar charts, eg. Gas (1.250) (version 1.0.12 or later):
<showvalues> yes (default) or no: hides the values
<format> Format mask of the values, eg. C0 $ or P1. If not set, the pie chart uses its own format; otherwise the values use the separators of the number format variables

If the legend is printed in the internal area of the graph, set a transparency factor (e.g. opacity = 0.5) so that you can see the graph below the legend.

Example

A semi-transparent legend printed over the chart area.

Legend example