ChartDirector Ver 5.0 (PHP Edition)

BaseChart.addLegend

Usage

addLegend(x, y [, vertical [, font [, fontSize ]]])

Description

Adds a legend box to the chart.
The entries in the legend box will flow from top to bottom (one line per entry), or from left to right and then top to bottom (like flowing text), depending on the vertical argument. For grid layout, use BaseChart.addLegend2.

Arguments

Argument | Default | Description
--- | --- | ---
x | (Mandatory) | The x coordinate of the reference point of the legend box. By default, the reference point is the top-left corner of the box, but can be configured by using TextBox.setAlignment.
y | (Mandatory) | The y coordinate of the reference point of the legend box. By default, the reference point is the top-left corner of the box, but can be configured by using TextBox.setAlignment.
vertical | true (non-zero) | A true (non-zero) value means the legend keys are laid out vertically (one line per entry). A false (zero) value means the legend keys are laid out horizontal and flow like text (from left to right, top to bottom).
font | "" | The font name of the font for drawing the legend text. The default is "normal". See Font Specification for details on various font attributes.
fontSize | 10 | The font size of the legend text.

Return Value

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

© 2009 Advanced Software Engineering Limited. All rights reserved.