Constructor
new Legend(chart)
Parameters:
Name | Type | Description |
---|---|---|
chart |
Tee.Chart | The parent chart this legend object belongs to. |
Properties:
Name | Type | Description |
---|---|---|
align |
Number | Legend position as offset % of chart size. Default 0. |
padding |
Number | Percent of chart size pixels to leave as margin from legend. |
transparent |
Boolean | Determines to draw or not the legend background. |
format |
Tee.Format | Formatting properties to draw legend background and items. |
hover |
Tee.Format | Limited Formatting properties for mouseover hover of text. Offers color and enabled. |
title |
Tee.Annotation | Draws a title on top of legend. |
bounds |
Rectangle | Defines the legend position in pixels. |
position |
String | Automatic position legend ("left", "top", "right" or "bottom"). |
visible |
Boolean | Defines to draw or not the legend. |
inverted |
Boolean | When true, legend items are displayed in inverted order. |
fontColor |
Boolean | Determines to fill each legend item text using series or point colors. |
dividing |
Stroke | Draws a line between legend items. |
symbol |
Symbol | Properties to draw a small indicator next to each legend item. |
legendStyle |
String | Determines to draw all visible series names or first visible series points. ("auto", "series", "values"). |
textStyle |
String | What to draw at each legend item for series values: "auto", "valuelabel", "label", "value", "percent", "index", "labelvalue", "percentlabel" |
- Source:
Classes
Methods
availRows() → {Number}
- Source:
Returns:
Returns the maximum number of vertical rows using the available height.
- Type
- Number
calcPadding() → {Number}
- Source:
Returns:
Returns the distance in pixels between legend and chart bounds.
- Type
- Number
calcWidths() → {Number}
- Source:
Returns:
Returns the maximum width in pixels of all legend items text.
- Type
- Number
drawSeries() → {Boolean}
- Source:
Returns:
Returns if index'th series is visible and has been displayed at legend.
- Type
- Boolean
isVertical() → {Boolean}
- Source:
Returns:
Returns if legend orientation is vertical.
- Type
- Boolean
itemsCount() → {Number}
- Source:
Returns:
Returns the number of legend items that should be displayed.
- Type
- Number
itemText() → {String}
- Source:
Returns:
Returns the index'th legend text string.
- Type
- String
showValues() → {Boolean}
- Source:
Returns:
Returns if legend shows series titles or a series values.
- Type
- Boolean
totalWidth() → {Number}
- Source:
Returns:
Returns the width in pixels of legend items, including text and symbols if visible.
- Type
- Number