ChartDirector Ver 3.1 (PHP Edition Edition)

LegendBox


The class LegendBox represents legend boxes. It is a subclass of TextBox.

Use BaseChart.addLegend to create a legend box object and add it to the chart.

By default, ChartDirector will automatically add every named data set to the legend box. For XY charts, Layer.setLegend can be used to modify this behaviour.

You may add custom entries to the legend box by using LegendBox.addKey.

MethodInheritedDescription
addKey(Self)Add a custom entry to the legend box.
setText(Self)Set the template of the legend text.
setKeySize(Self)Set the size of the legend icon and its distance from the legend text.
setKeySpacing(Self)Set the distance between two legend entries.
getImageCoor2(Self)Get the image map coordinates of an legend entry as HTML image map attributes.
getHTMLImageMap(Self)Generate an HTML image map for the legend box.
setFontStyleTextBoxSet the font of the text by specifying the file that contains the font.
setFontSizeTextBoxSet the font height and width in points.
setFontAngleTextBoxSet the rotation angle and layout direction of the text.
setFontColorTextBoxSet the color of the text.
setMarginTextBoxSet all margins (left, right, top, and bottom) of the text box to the same value.
setMargin2TextBoxSet the margins of the text box in pixels.
setAlignmentTextBoxSet the alignment of the text relative to the container box.
setPosBoxSet the coordinates of the top-left corner of the box.
setSizeBoxSet the width and height of the box.
setBackgroundBoxSet the background color, border color and 3D border effect of the box.
getWidthBoxGet the width of the box.
getHeightBoxGet the height of the box.
getImageCoorBoxGet the image map coordinates of the box as HTML image map attributes.