Class Legend
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Legend
-
- All Implemented Interfaces:
Serializable
,OptionDataListener
,org.zkoss.json.JSONAware
public class Legend extends Optionable
The legend is a box containing a symbol and name for each series item or point item in the chart.All the options in this class support
DynamicalAttribute
.- Author:
- jumperchen, RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Legend()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LegendAccessibility
getAccessibility()
Accessibility options for the legend, or create a new one.String
getAlign()
Returns the horizontal alignment of the legend box within the chart area.Color
getBackgroundColor()
Returns the background color of the legend, filling the rounded corner border.Color
getBorderColor()
Returns the color of the drawn border around the legend.Object
getBorderRadius()
Returns the border corner radius of the legend.Number
getBorderWidth()
Returns the width of the drawn border around the legend.BubbleLegend
getBubbleLegend()
Returns the bubble legend, which is an additional element in legend which presents the scale of the bubble series.Number
getItemDistance()
Returns in a legend with horizontal layout, the itemDistance defines the pixel distance between each item.<K,V>
Map<K,V>getItemHiddenStyle()
Returns CSS styles for each legend item when the corresponding series or point is hidden.<K,V>
Map<K,V>getItemHoverStyle()
Returns CSS styles for each legend item in hover mode.Number
getItemMarginBottom()
Returns the pixel bottom margin for each legend item.Number
getItemMarginTop()
Returns the pixel top margin for each legend item.<K,V>
Map<K,V>getItemStyle()
Returns CSS styles for each legend item.Number
getItemWidth()
Returns the width for each legend item.String
getLabelFormat()
Returns a format string for each legend label.String
getLayout()
Returns the layout of the legend items.Number
getMargin()
Returns if the plot area sized is calculated automatically and the legend is not floating, the legend margin is the space between the legend and the axis labels or plot area.Number
getMaxHeight()
Returns maximum pixel height for the legend.LegendNavigation
getNavigation()
Returns options for the paging or navigation appearing when the legend is overflown.Number
getPadding()
Returns the inner padding of the legend box.Shadow
getShadow()
Returns whether to apply a drop shadow to the legend.Number
getSymbolHeight()
Returns the pixel height of the legend item symbol.Number
getSymbolPadding()
Returns the pixel padding between the legend item symbol and the legend item text.Number
getSymbolRadius()
Returns the pixel radius of the legend item symbol.Number
getSymbolWidth()
Returns the pixel width of the legend item symbol.LegendTitle
getTitle()
Returns a title to be added on top of the legend.String
getVerticalAlign()
Returns the vertical alignment of the legend box.Number
getWidth()
Returns the width of the legend box.Number
getX()
Returns the x offset of the legend relative to it's horizontal alignmentalign
within chart.spacingLeft and chart.spacingRight.Number
getY()
Returns the vertical offset of the legend relative to it's vertical alignmentverticalAlign
within chart.spacingTop and chart.spacingBottom.boolean
isAlignColumns()
Returns if the layout is horizontal and the legend items span over two lines or more, whether to align the items into vertical columns.boolean
isEnabled()
Returns enable or disable the legend.boolean
isFloating()
Returns when the legend is floating, the plot area ignores it and is allowed to be placed below it.boolean
isReversed()
Returns whether to reverse the order of the legend items compared to the order of the series or points as defined in the configuration object.boolean
isRtl()
Returns whether to show the symbol on the right side of the text rather than the left side.boolean
isShadow()
Returns whether to apply a drop shadow to the legend.boolean
isSquareSymbol()
When this is true, the legend symbol width will be the same as the symbol height, which in turn defaults to the font size of the legend items.boolean
isUseHTML()
Returns whether to use HTML to render the legend item texts.void
setAccessibility(LegendAccessibility accessibility)
Accessibility options for the legend, or create a new one.void
setAlign(String align)
Sets the horizontal alignment of the legend box within the chart area.void
setAlignColumns(boolean alignColumns)
Sets if the layout is horizontal and the legend items span over two lines or more, whether to align the items into vertical columns.void
setBackgroundColor(String color)
Sets the background color of the legend, filling the rounded corner border.void
setBackgroundColor(Color color)
Sets the background color of the legend, filling the rounded corner border.void
setBackgroundColor(LinearGradient color)
Sets the background color of the legend, filling the rounded corner border.void
setBackgroundColor(RadialGradient color)
Sets the background color of the legend, filling the rounded corner border.void
setBorderColor(String color)
Sets the color of the drawn border around the legend.void
setBorderColor(Color color)
Sets the color of the drawn border around the legend.void
setBorderColor(LinearGradient color)
Sets the color of the drawn border around the legend.void
setBorderColor(RadialGradient color)
Sets the color of the drawn border around the legend.void
setBorderRadius(Number borderRadius)
Sets the border corner radius of the legend.void
setBorderRadius(String borderRadius)
Sets the border corner radius of the legend.void
setBorderWidth(Number borderWidth)
Sets the width of the drawn border around the legend.void
setBubbleLegend(BubbleLegend bubbleLegend)
Sets the bubble legend, which is an additional element in legend which presents the scale of the bubble series.void
setEnabled(boolean enabled)
Sets enable or disable the legend.void
setFloating(boolean floating)
Sets when the legend is floating, the plot area ignores it and is allowed to be placed below it.void
setItemDistance(Number itemDistance)
Sets in a legend with horizontal layout, the itemDistance defines the pixel distance between each item.void
setItemHiddenStyle(String itemHiddenStyle)
Sets CSS styles for each legend item when the corresponding series or point is hidden.<K,V>
voidsetItemHiddenStyle(Map<K,V> itemHiddenStyle)
Sets CSS styles for each legend item when the corresponding series or point is hidden.void
setItemHoverStyle(String itemHoverStyle)
Sets CSS styles for each legend item in hover mode.<K,V>
voidsetItemHoverStyle(Map<K,V> itemHoverStyle)
Sets CSS styles for each legend item in hover mode.void
setItemMarginBottom(Number itemMarginBottom)
Sets the pixel bottom margin for each legend item.void
setItemMarginTop(Number itemMarginTop)
Sets the pixel top margin for each legend item.void
setItemStyle(String itemStyle)
Sets CSS styles for each legend item.<K,V>
voidsetItemStyle(Map<K,V> itemStyle)
Sets CSS styles for each legend item.void
setItemWidth(Number itemWidth)
Sets the width for each legend item.void
setLabelFormat(String labelFormat)
Sets a format string for each legend label.void
setLayout(String layout)
Sets the layout of the legend items.void
setMargin(Number margin)
Sets if the plot area sized is calculated automatically and the legend is not floating, the legend margin is the space between the legend and the axis labels or plot area.void
setMaxHeight(Number maxHeight)
Sets maximum pixel height for the legend.void
setNavigation(LegendNavigation navigation)
Sets options for the paging or navigation appearing when the legend is overflown.void
setPadding(Number padding)
Sets the inner padding of the legend box.void
setReversed(boolean reversed)
Sets whether to reverse the order of the legend items compared to the order of the series or points as defined in the configuration object.void
setRtl(boolean rtl)
Sets whether to show the symbol on the right side of the text rather than the left side.void
setShadow(boolean shadow)
Sets whether to apply a drop shadow to the legend.void
setShadow(Shadow shadow)
Sets whether to apply a drop shadow to the legend.void
setSquareSymbol(boolean squareSymbol)
When this is true, the legend symbol width will be the same as the symbol height, which in turn defaults to the font size of the legend items.void
setSymbolHeight(Number symbolHeight)
Sets the pixel height of the legend item symbol.void
setSymbolPadding(Number symbolPadding)
Sets the pixel padding between the legend item symbol and the legend item text.void
setSymbolRadius(Number symbolRadius)
Sets the pixel radius of the legend item symbol.void
setSymbolWidth(Number symbolWidth)
Sets the pixel width of the legend item symbol.void
setTitle(LegendTitle title)
Sets a title to be added on top of the legend.void
setUseHTML(boolean useHTML)
Sets whether to use HTML to render the legend item texts.void
setVerticalAlign(String verticalAlign)
Sets the vertical alignment of the legend box.void
setWidth(Number width)
Sets the width of the legend box.void
setX(Number x)
Sets the x offset of the legend relative to it's horizontal alignmentalign
within chart.spacingLeft and chart.spacingRight.void
setY(Number y)
Sets the vertical offset of the legend relative to it's vertical alignmentverticalAlign
within chart.spacingTop and chart.spacingBottom.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
getAccessibility
public LegendAccessibility getAccessibility()
Accessibility options for the legend, or create a new one.Default: an instance of
LegendAccessibility
- Since:
- 10.2.1.0
-
setAccessibility
public void setAccessibility(LegendAccessibility accessibility)
Accessibility options for the legend, or create a new one.Default: an instance of
LegendAccessibility
- Since:
- 10.2.1.0
-
getAlign
public String getAlign()
Returns the horizontal alignment of the legend box within the chart area. Valid values are"left"
,"center"
and"right"
.Default: "center".
-
setAlign
public void setAlign(String align)
Sets the horizontal alignment of the legend box within the chart area. Valid values are"left"
,"center"
and"right"
.
-
isAlignColumns
public boolean isAlignColumns()
Returns if the layout is horizontal and the legend items span over two lines or more, whether to align the items into vertical columns. Setting this to false makes room for more items, but will look more messy.Default: true
- Since:
- 7.2.1.0
-
setAlignColumns
public void setAlignColumns(boolean alignColumns)
Sets if the layout is horizontal and the legend items span over two lines or more, whether to align the items into vertical columns. Setting this to false makes room for more items, but will look more messy.- Since:
- 7.2.1.0
-
getBackgroundColor
public Color getBackgroundColor()
Returns the background color of the legend, filling the rounded corner border.Default: null.
-
setBackgroundColor
public void setBackgroundColor(Color color)
Sets the background color of the legend, filling the rounded corner border.
-
setBackgroundColor
public void setBackgroundColor(String color)
Sets the background color of the legend, filling the rounded corner border.
-
setBackgroundColor
public void setBackgroundColor(LinearGradient color)
Sets the background color of the legend, filling the rounded corner border.
-
setBackgroundColor
public void setBackgroundColor(RadialGradient color)
Sets the background color of the legend, filling the rounded corner border.
-
getBorderColor
public Color getBorderColor()
Returns the color of the drawn border around the legend.Default: "#909090".
-
setBorderColor
public void setBorderColor(Color color)
Sets the color of the drawn border around the legend.
-
setBorderColor
public void setBorderColor(String color)
Sets the color of the drawn border around the legend.
-
setBorderColor
public void setBorderColor(LinearGradient color)
Sets the color of the drawn border around the legend.
-
setBorderColor
public void setBorderColor(RadialGradient color)
Sets the color of the drawn border around the legend.
-
getBorderRadius
public Object getBorderRadius()
Returns the border corner radius of the legend.Default: 0.
- Returns:
- borderRadius the border corner radius of the legend
-
setBorderRadius
public void setBorderRadius(Number borderRadius)
Sets the border corner radius of the legend.- Parameters:
borderRadius
- the border corner radius of the legend
-
setBorderRadius
public void setBorderRadius(String borderRadius)
Sets the border corner radius of the legend.- Parameters:
borderRadius
- the border corner radius of the legend
-
getBorderWidth
public Number getBorderWidth()
Returns the width of the drawn border around the legend.Default: 0.
- Returns:
- borderWidth the width of the drawn border around the legend
-
setBorderWidth
public void setBorderWidth(Number borderWidth)
Sets the width of the drawn border around the legend.
-
isEnabled
public boolean isEnabled()
Returns enable or disable the legend.Default: true.
- Returns:
- enabled enable or disable the legend
-
setEnabled
public void setEnabled(boolean enabled)
Sets enable or disable the legend.- Parameters:
enabled
- enable or disable the legend
-
getBubbleLegend
public BubbleLegend getBubbleLegend()
Returns the bubble legend, which is an additional element in legend which presents the scale of the bubble series. Creates a new one if none is set. Individual bubble ranges can be defined by user or calculated from series. In the case of automatically calculated ranges, a 1px margin of error is permitted.- Since:
- 7.2.1.0
-
setBubbleLegend
public void setBubbleLegend(BubbleLegend bubbleLegend)
Sets the bubble legend, which is an additional element in legend which presents the scale of the bubble series. Individual bubble ranges can be defined by user or calculated from series. In the case of automatically calculated ranges, a 1px margin of error is permitted.- Since:
- 7.2.1.0
-
isFloating
public boolean isFloating()
Returns when the legend is floating, the plot area ignores it and is allowed to be placed below it.Default: false.
- Returns:
- floating when the legend is floating, the plot area ignores it and is allowed to be placed below it
-
setFloating
public void setFloating(boolean floating)
Sets when the legend is floating, the plot area ignores it and is allowed to be placed below it.- Parameters:
floating
- when the legend is floating, the plot area ignores it and is allowed to be placed below it
-
getItemDistance
public Number getItemDistance()
Returns in a legend with horizontal layout, the itemDistance defines the pixel distance between each item.Default: 8.
- Returns:
- itemDistance in a legend with horizontal layout, the itemDistance defines the pixel distance between each item
-
setItemDistance
public void setItemDistance(Number itemDistance)
Sets in a legend with horizontal layout, the itemDistance defines the pixel distance between each item.- Parameters:
itemDistance
- in a legend with horizontal layout, the itemDistance defines the pixel distance between each item
-
getItemHiddenStyle
public <K,V> Map<K,V> getItemHiddenStyle()
Returns CSS styles for each legend item when the corresponding series or point is hidden. Only a subset of CSS is supported, notably those options related to text. Properties are inherited fromstyle
unless overridden here. Defaults to:color: #CCC;
- Type Parameters:
K
- type for the keyif style was set using
setItemHiddenStyle(String)
, type will be Stringif style was set using
setItemHiddenStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
V
- type for the valueif style was set using
setItemHiddenStyle(String)
, type will be Stringif style was set using
setItemHiddenStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
-
setItemHiddenStyle
public void setItemHiddenStyle(String itemHiddenStyle)
Sets CSS styles for each legend item when the corresponding series or point is hidden. Only a subset of CSS is supported, notably those options related to text. Properties are inherited fromstyle
unless overridden here.This method allows simple settings like
label.setStyle("fontWeight: 'bold'; color: 'white'; textShadow: '0px 1px 2px black'");
In the format of CSS key:value, and ";" separating multiple key:value pairs, if you have more a complex CSS styling, we recommend using
setItemHiddenStyle(Map)
- Parameters:
itemHiddenStyle
- one or many CSS key:value pairs in a single line string format
-
setItemHiddenStyle
public <K,V> void setItemHiddenStyle(Map<K,V> itemHiddenStyle)
Sets CSS styles for each legend item when the corresponding series or point is hidden. Only a subset of CSS is supported, notably those options related to text. Properties are inherited fromstyle
unless overridden here.This method allows complex styling like:
Map<String, Object> styles = new HashMap<String, Object>(); styles.put("fill", "#E8E8EA"); styles.put("stroke", "#6E6E78"); styles.put("stroke-width", "1"); styles.put("r", "0"); Map<String, Object> states = new HashMap<String, Object>(); Map<String, String> hover = new HashMap<String, String>(); hover.put("fill", "#F4F4F6"); hover.put("stroke", "#6E6E78"); hover.put("stroke-width", "1"); hover.put("r", "0"); states.put("hover", hover); styles.put("states", states); Map<String, String> style = new HashMap<String, String>(); style.put("color", "#4D5663"); style.put("fontSize", "12px"); style.put("fontFamily", "'Arial'"); style.put("fontWeight", "normal"); style.put("padding", "10px"); styles.put("style", style);
{ "fill": "#E8E8EA", "stroke": "#6E6E78", "stroke-width": "1", "r": "0", "states": { "hover": { "fill": "#F4F4F6", "stroke": "#6E6E78", "stroke-width": "1", "r": "0" } }, "style": { "color": "#4D5663", "fontSize": "12px", "fontFamily": "'Arial'", "fontWeight": "normal", "padding": "10px" } }
- Type Parameters:
K
- Type for the key, usually StringV
- Type for the value, usually String. For nested maps, use Object or any other type.- Parameters:
itemHiddenStyle
- the style object
-
getItemHoverStyle
public <K,V> Map<K,V> getItemHoverStyle()
Returns CSS styles for each legend item in hover mode. Only a subset of CSS is supported, notably those options related to text. Properties are inherited fromstyle
unless overridden here. Defaults to:color: #000;
- Type Parameters:
K
- type for the keyif style was set using
setItemHoverStyle(String)
, type will be Stringif style was set using
setItemHoverStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
V
- type for the valueif style was set using
setItemHoverStyle(String)
, type will be Stringif style was set using
setItemHoverStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
-
setItemHoverStyle
public void setItemHoverStyle(String itemHoverStyle)
Sets CSS styles for each legend item in hover mode. Only a subset of CSS is supported, notably those options related to text. Properties are inherited fromstyle
unless overridden here.This method allows simple settings like
label.setStyle("fontWeight: 'bold'; color: 'white'; textShadow: '0px 1px 2px black'");
In the format of CSS key:value, and ";" separating multiple key:value pairs, if you have more a complex CSS styling, we recommend using
setItemHoverStyle(Map)
- Parameters:
itemHoverStyle
- one or many CSS key:value pairs in a single line string format
-
setItemHoverStyle
public <K,V> void setItemHoverStyle(Map<K,V> itemHoverStyle)
Sets CSS styles for each legend item in hover mode. Only a subset of CSS is supported, notably those options related to text. Properties are inherited fromstyle
unless overridden here.This method allows complex styling like:
Map<String, Object> styles = new HashMap<String, Object>(); styles.put("fill", "#E8E8EA"); styles.put("stroke", "#6E6E78"); styles.put("stroke-width", "1"); styles.put("r", "0"); Map<String, Object> states = new HashMap<String, Object>(); Map<String, String> hover = new HashMap<String, String>(); hover.put("fill", "#F4F4F6"); hover.put("stroke", "#6E6E78"); hover.put("stroke-width", "1"); hover.put("r", "0"); states.put("hover", hover); styles.put("states", states); Map<String, String> style = new HashMap<String, String>(); style.put("color", "#4D5663"); style.put("fontSize", "12px"); style.put("fontFamily", "'Arial'"); style.put("fontWeight", "normal"); style.put("padding", "10px"); styles.put("style", style);
{ "fill": "#E8E8EA", "stroke": "#6E6E78", "stroke-width": "1", "r": "0", "states": { "hover": { "fill": "#F4F4F6", "stroke": "#6E6E78", "stroke-width": "1", "r": "0" } }, "style": { "color": "#4D5663", "fontSize": "12px", "fontFamily": "'Arial'", "fontWeight": "normal", "padding": "10px" } }
- Type Parameters:
K
- Type for the key, usually StringV
- Type for the value, usually String. For nested maps, use Object or any other type.- Parameters:
itemHoverStyle
- the style object
-
getItemMarginBottom
public Number getItemMarginBottom()
Returns the pixel bottom margin for each legend item.Default: 0
-
setItemMarginBottom
public void setItemMarginBottom(Number itemMarginBottom)
Sets the pixel bottom margin for each legend item.
-
getItemMarginTop
public Number getItemMarginTop()
Returns the pixel top margin for each legend item.Default: 0
-
setItemMarginTop
public void setItemMarginTop(Number itemMarginTop)
Sets the pixel top margin for each legend item.
-
getItemStyle
public <K,V> Map<K,V> getItemStyle()
Returns CSS styles for each legend item. Only a subset of CSS is supported, notably those options related to text. Defaults to:cursor: pointer; color: #274b6d; fontSize: 12px;
- Type Parameters:
K
- type for the keyif style was set using
setItemStyle(String)
, type will be Stringif style was set using
setItemStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
V
- type for the valueif style was set using
setItemStyle(String)
, type will be Stringif style was set using
setItemStyle(Map)
, type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
-
setItemStyle
public void setItemStyle(String itemStyle)
Sets CSS styles for each legend item. Only a subset of CSS is supported, notably those options related to text.This method allows simple settings like
label.setStyle("fontWeight: 'bold'; color: 'white'; textShadow: '0px 1px 2px black'");
In the format of CSS key:value, and ";" separating multiple key:value pairs, if you have more a complex CSS styling, we recommend using
setItemStyle(Map)
- Parameters:
itemStyle
- one or many CSS key:value pairs in a single line string format
-
setItemStyle
public <K,V> void setItemStyle(Map<K,V> itemStyle)
Sets CSS styles for each legend item. Only a subset of CSS is supported, notably those options related to text.This method allows complex styling like:
Map<String, Object> styles = new HashMap<String, Object>(); styles.put("fill", "#E8E8EA"); styles.put("stroke", "#6E6E78"); styles.put("stroke-width", "1"); styles.put("r", "0"); Map<String, Object> states = new HashMap<String, Object>(); Map<String, String> hover = new HashMap<String, String>(); hover.put("fill", "#F4F4F6"); hover.put("stroke", "#6E6E78"); hover.put("stroke-width", "1"); hover.put("r", "0"); states.put("hover", hover); styles.put("states", states); Map<String, String> style = new HashMap<String, String>(); style.put("color", "#4D5663"); style.put("fontSize", "12px"); style.put("fontFamily", "'Arial'"); style.put("fontWeight", "normal"); style.put("padding", "10px"); styles.put("style", style);
{ "fill": "#E8E8EA", "stroke": "#6E6E78", "stroke-width": "1", "r": "0", "states": { "hover": { "fill": "#F4F4F6", "stroke": "#6E6E78", "stroke-width": "1", "r": "0" } }, "style": { "color": "#4D5663", "fontSize": "12px", "fontFamily": "'Arial'", "fontWeight": "normal", "padding": "10px" } }
- Type Parameters:
K
- Type for the key, usually StringV
- Type for the value, usually String. For nested maps, use Object or any other type.- Parameters:
itemStyle
- the style object
-
getItemWidth
public Number getItemWidth()
Returns the width for each legend item. This is useful in a horizontal layout with many items when you want the items to align vertically. .Default: null.
-
setItemWidth
public void setItemWidth(Number itemWidth)
Sets the width for each legend item. This is useful in a horizontal layout with many items when you want the items to align vertically. .- Parameters:
itemWidth
- the width for each legend item
-
getLabelFormat
public String getLabelFormat()
Returns a format string for each legend label. Available variables relates to properties on the series, or the point in case of pies.Default: "{name}".
-
setLabelFormat
public void setLabelFormat(String labelFormat)
Sets a format string for each legend label. Available variables relates to properties on the series, or the point in case of pies.
-
getLayout
public String getLayout()
Returns the layout of the legend items. Can be one of "horizontal" or "vertical" or "proximate".Default: "horizontal".
-
setLayout
public void setLayout(String layout)
Sets the layout of the legend items. Can be one of "horizontal" or "vertical" or "proximate".- Parameters:
layout
- the layout of the legend items
-
getMargin
public Number getMargin()
Returns if the plot area sized is calculated automatically and the legend is not floating, the legend margin is the space between the legend and the axis labels or plot area.Default: 15.
-
setMargin
public void setMargin(Number margin)
Sets if the plot area sized is calculated automatically and the legend is not floating, the legend margin is the space between the legend and the axis labels or plot area.
-
getMaxHeight
public Number getMaxHeight()
Returns maximum pixel height for the legend. When the maximum height is extended, navigation will show.- Returns:
- maxHeight maximum pixel height for the legend
-
setMaxHeight
public void setMaxHeight(Number maxHeight)
Sets maximum pixel height for the legend. When the maximum height is extended, navigation will show.- Parameters:
maxHeight
- maximum pixel height for the legend
-
getNavigation
public LegendNavigation getNavigation()
Returns options for the paging or navigation appearing when the legend is overflown. WhensetUseHTML(boolean)
is enabled, navigation is disabled.Default: an instance of
LegendNavigation
- See Also:
LegendNavigation
-
setNavigation
public void setNavigation(LegendNavigation navigation)
Sets options for the paging or navigation appearing when the legend is overflown. WhensetUseHTML(boolean)
is enabled, navigation is disabled.- See Also:
LegendNavigation
-
getPadding
public Number getPadding()
Returns the inner padding of the legend box.Default: 8.
- Returns:
- padding the inner padding of the legend box
-
setPadding
public void setPadding(Number padding)
Sets the inner padding of the legend box.- Parameters:
padding
- the inner padding of the legend box
-
isReversed
public boolean isReversed()
Returns whether to reverse the order of the legend items compared to the order of the series or points as defined in the configuration object.Default: false.
-
setReversed
public void setReversed(boolean reversed)
Sets whether to reverse the order of the legend items compared to the order of the series or points as defined in the configuration object.
-
isRtl
public boolean isRtl()
Returns whether to show the symbol on the right side of the text rather than the left side. This is common in Arabic and Hebraic.Default: false.
-
setRtl
public void setRtl(boolean rtl)
Sets whether to show the symbol on the right side of the text rather than the left side. This is common in Arabic and Hebraic.
-
isShadow
public boolean isShadow()
Returns whether to apply a drop shadow to the legend. Requires that backgroundColor be set.Default: false.
- See Also:
Shadow
-
getShadow
public Shadow getShadow()
Returns whether to apply a drop shadow to the legend. Requires that backgroundColor be set.Default:
Shadow.NONE
.- See Also:
Shadow
-
setShadow
public void setShadow(boolean shadow)
Sets whether to apply a drop shadow to the legend. Requires that backgroundColor be set.
-
setShadow
public void setShadow(Shadow shadow)
Sets whether to apply a drop shadow to the legend. Requires that backgroundColor be set.- See Also:
Shadow
-
isSquareSymbol
public boolean isSquareSymbol()
When this is true, the legend symbol width will be the same as the symbol height, which in turn defaults to the font size of the legend items.Default: true
- Since:
- 7.2.1.0
-
setSquareSymbol
public void setSquareSymbol(boolean squareSymbol)
When this is true, the legend symbol width will be the same as the symbol height, which in turn defaults to the font size of the legend items.- Since:
- 7.2.1.0
-
getSymbolHeight
public Number getSymbolHeight()
Returns the pixel height of the legend item symbol.Default: 12.
-
setSymbolHeight
public void setSymbolHeight(Number symbolHeight)
Sets the pixel height of the legend item symbol.
-
getSymbolPadding
public Number getSymbolPadding()
Returns the pixel padding between the legend item symbol and the legend item text.Default: 5.
-
setSymbolPadding
public void setSymbolPadding(Number symbolPadding)
Sets the pixel padding between the legend item symbol and the legend item text.
-
getSymbolRadius
public Number getSymbolRadius()
Returns the pixel radius of the legend item symbol.Default: 2.
-
setSymbolRadius
public void setSymbolRadius(Number symbolRadius)
Sets the pixel radius of the legend item symbol.
-
getSymbolWidth
public Number getSymbolWidth()
Returns the pixel width of the legend item symbol.Default: 16.
- Returns:
- symbolWidth the pixel width of the legend item symbol
-
setSymbolWidth
public void setSymbolWidth(Number symbolWidth)
Sets the pixel width of the legend item symbol.
-
getTitle
public LegendTitle getTitle()
Returns a title to be added on top of the legend.Default: .
- Returns:
- title a title to be added on top of the legend
-
setTitle
public void setTitle(LegendTitle title)
Sets a title to be added on top of the legend.- Parameters:
title
- a title to be added on top of the legend
-
isUseHTML
public boolean isUseHTML()
Returns whether to use HTML to render the legend item texts. When using HTML,setNavigation(LegendNavigation)
is disabled.Default: false.
-
setUseHTML
public void setUseHTML(boolean useHTML)
Sets whether to use HTML to render the legend item texts. When using HTML,setNavigation(LegendNavigation)
is disabled.
-
getVerticalAlign
public String getVerticalAlign()
Returns the vertical alignment of the legend box. Can be one of "top", "middle" or "bottom". Vertical position can be further determined by they
option.Default: "bottom".
-
setVerticalAlign
public void setVerticalAlign(String verticalAlign)
Sets the vertical alignment of the legend box. Can be one of "top", "middle" or "bottom". Vertical position can be further determined by they
option.
-
getWidth
public Number getWidth()
Returns the width of the legend box.Default: null.
- Returns:
- the width of the legend box
-
setWidth
public void setWidth(Number width)
Sets the width of the legend box.
-
getX
public Number getX()
Returns the x offset of the legend relative to it's horizontal alignmentalign
within chart.spacingLeft and chart.spacingRight. Negative x moves it to the left, positive x moves it to the right.Default: 0.
-
setX
public void setX(Number x)
Sets the x offset of the legend relative to it's horizontal alignmentalign
within chart.spacingLeft and chart.spacingRight. Negative x moves it to the left, positive x moves it to the right.
-
getY
public Number getY()
Returns the vertical offset of the legend relative to it's vertical alignmentverticalAlign
within chart.spacingTop and chart.spacingBottom. Negative y moves it up, positive y moves it down.Default: 0.
-
setY
public void setY(Number y)
Sets the vertical offset of the legend relative to it's vertical alignmentverticalAlign
within chart.spacingTop and chart.spacingBottom. Negative y moves it up, positive y moves it down.
-
-