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.
Method | Inherited | Description |
---|---|---|
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. |
setFontStyle | TextBox | Set the font of the text by specifying the file that contains the font. |
setFontSize | TextBox | Set the font height and width in points. |
setFontAngle | TextBox | Set the rotation angle and layout direction of the text. |
setFontColor | TextBox | Set the color of the text. |
setMargin | TextBox | Set all margins (left, right, top, and bottom) of the text box to the same value. |
setMargin2 | TextBox | Set the margins of the text box in pixels. |
setAlignment | TextBox | Set the alignment of the text relative to the container box. |
setPos | Box | Set the coordinates of the top-left corner of the box. |
setSize | Box | Set the width and height of the box. |
setBackground | Box | Set the background color, border color and 3D border effect of the box. |
getWidth | Box | Get the width of the box. |
getHeight | Box | Get the height of the box. |
getImageCoor | Box | Get the image map coordinates of the box as HTML image map attributes. |