ChartDirector Ver 3.0 (C++ Edition)

BaseChart.addLegend


Usage

LegendBox *addLegend(int x, int y, bool vertical = true, const char *font = 0, double fontHeight = 10);

Description

Add a legend box to the chart.

Arguments

ArgumentDefaultDescription
x(Mandatory)The x coordinate of the left of the legend box.
y(Mandatory)The y coordinate of the top of the legend box.
verticaltrueDetermine if the legend keys are laid out vertically (from top to bottom) or horizontally (from left to right, top to bottom). A true value means vertical layout. A false value means horizontal layout.
font""The font file for the legend font. The default is arial.ttf (Arial). See Font Specification for details on various font attributes.
fontSize10The font size of the legend font.

Return Value

A LegendBox object representing the legend box. You may use this object to fine-tune the appearance of the legend box.