ChartDirector 7.1 (C++ Edition)

LegendBox.addKey


Usage

void addKey(const char *text, int color, int lineWidth = 0, const DrawArea *drawarea = 0);

Description

Adds a custom entry to the legend box.

This method adds an entry within a legend entry priority of 1 (followed by 2, 3, 4, ... for repeated calls). This has higher priority than entries added automatically by ChartDirector for representing data sets. As a result, by default, the custom entry will appear before the automatic entries.

To control the order of the custom entry relative to the automatic entries, use LegendBox.addKey2.

See LegendBox for more information on legend entry priority system.

Arguments

ArgumentDefaultDescription
text(Mandatory)The text of the legend entry.
color(Mandatory)The icon color of the legend entry.
lineWidth0The line width for legend entry that represents lines in line charts.
drawarea[Null]A DrawArea containing the data symbol for the legend entry. This is primarily used for legend entries in scatter charts or in line charts with data symbols.

Return Value

None