HighchartsLegendOptions class

The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend.

It is possible to override the symbol creator function and create custom legend symbols.

API Docs: https://api.highcharts.com/highcharts/legend

Inheritance

Constructors

HighchartsLegendOptions.new({HighchartsLegendAccessibilityOptions? accessibility, String? align, bool? alignColumns, String? backgroundColor, String? borderColor, double? borderRadius, double? borderWidth, HighchartsLegendBubbleLegendOptions? bubbleLegend, String? className, bool? enabled, HighchartsLegendEventsOptions? events, bool? floating, Map<String, String>? itemCheckboxStyle, double? itemDistance, Map<String, String>? itemHiddenStyle, Map<String, String>? itemHoverStyle, double? itemMarginBottom, double? itemMarginTop, Map<String, String>? itemStyle, double? itemWidth, String? labelFormat, dynamic labelFormatter, String? layout, double? lineHeight, double? margin, double? maxHeight, HighchartsLegendNavigationOptions? navigation, double? padding, bool? reversed, bool? rtl, Map<String, String>? shadow, bool? squareSymbol, Map<String, String>? style, double? symbolHeight, double? symbolPadding, double? symbolRadius, double? symbolWidth, HighchartsLegendTitleOptions? title, bool? useHTML, double? valueDecimals, String? valueSuffix, String? verticalAlign, dynamic width, double? x, double? y})
The legend is a box containing a symbol and name for each series item or point item in the chart. Each series (or points in case of pie charts) is represented by a symbol and its name in the legend.

Properties

accessibility HighchartsLegendAccessibilityOptions?
Accessibility options for the legend. Requires the Accessibility module.
getter/setter pair
align String?
The horizontal alignment of the legend box within the chart area. Valid values are left, center and right.
getter/setter pair
alignColumns bool?
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.
getter/setter pair
backgroundColor String?
The background color of the legend.
getter/setter pair
borderColor String?
The color of the drawn border around the legend.
getter/setter pair
borderRadius double?
The border corner radius of the legend.
getter/setter pair
borderWidth double?
The width of the drawn border around the legend.
getter/setter pair
bubbleLegend HighchartsLegendBubbleLegendOptions?
The bubble legend 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.
getter/setter pair
className String?
A CSS class name to apply to the legend group.
getter/setter pair
enabled bool?
Enable or disable the legend. There is also a series-specific option, showInLegend, that can hide the series from the legend. In some series types this is false by default, so it must set to true in order to show the legend for the series.
getter/setter pair
events HighchartsLegendEventsOptions?
General event handlers for the legend. These event hooks can also be attached to the legend at run time using the Highcharts.addEvent function.
getter/setter pair
floating bool?
When the legend is floating, the plot area ignores it and is allowed to be placed below it.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
itemCheckboxStyle Map<String, String>?
Default styling for the checkbox next to a legend item when showCheckbox is true.
getter/setter pair
itemDistance double?
In a legend with horizontal layout, the itemDistance defines the pixel distance between each item.
getter/setter pair
itemHiddenStyle Map<String, String>?
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 from style unless overridden here.
getter/setter pair
itemHoverStyle Map<String, String>?
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 from style unless overridden here.
getter/setter pair
itemMarginBottom double?
The pixel bottom margin for each legend item.
getter/setter pair
itemMarginTop double?
The pixel top margin for each legend item.
getter/setter pair
itemStyle Map<String, String>?
CSS styles for each legend item. Only a subset of CSS is supported, notably those options related to text. The default textOverflow property makes long texts truncate. Set it to undefined to wrap text instead. A width property can be added to control the text width.
getter/setter pair
itemWidth double?
The width for each legend item. By default the items are laid out successively. In a horizontal layout, if the items are laid out across two rows or more, they will be vertically aligned depending on the legend.alignColumns option.
getter/setter pair
labelFormat String?
A format string for each legend label. Available variables relates to properties on the series, or the point in case of pies.
getter/setter pair
labelFormatter ↔ dynamic
Callback function to format each of the series' labels. The this keyword refers to the series object, or the point object in case of pie charts. By default the series or point name is printed.
getter/setter pair
layout String?
The layout of the legend items. Can be one of horizontal or vertical or proximate. When proximate, the legend items will be placed as close as possible to the graphs they're representing, except in inverted charts or when the legend position doesn't allow it.
getter/setter pair
lineHeight double?
Line height for the legend items. Deprecated as of 2.1. Instead, the line height for each item can be set using itemStyle.lineHeight, and the padding between items using itemMarginTop and itemMarginBottom.
getter/setter pair
margin double?
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.
getter/setter pair
maxHeight double?
Maximum pixel height for the legend. When the maximum height is extended, navigation will show.
getter/setter pair
Options for the paging or navigation appearing when the legend is overflown. Navigation works well on screen, but not in static exported images. One way of working around that is to increase the chart height in export.
getter/setter pair
padding double?
The inner padding of the legend box.
getter/setter pair
reversed bool?
Whether to reverse the order of the legend items compared to the order of the series or points as defined in the configuration object.
getter/setter pair
rtl bool?
Whether to show the symbol on the right side of the text rather than the left side. This is common in Arabic and Hebrew.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadow Map<String, String>?
Whether to apply a drop shadow to the legend. A backgroundColor also needs to be applied for this to take effect. The shadow can be an object configuration containing color, offsetX, offsetY, opacity and width.
getter/setter pair
squareSymbol bool?
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.
getter/setter pair
style Map<String, String>?
CSS styles for the legend area. In the 1.x versions the position of the legend area was determined by CSS. In 2.x, the position is determined by properties like align, verticalAlign, x and y, but the styles are still parsed for backwards compatibility.
getter/setter pair
symbolHeight double?
The pixel height of the symbol for series types that use a rectangle in the legend. Defaults to the font size of legend items.
getter/setter pair
symbolPadding double?
The pixel padding between the legend item symbol and the legend item text.
getter/setter pair
symbolRadius double?
The border radius of the symbol for series types that use a rectangle in the legend. Defaults to half the symbolHeight, effectively creating a circle.
getter/setter pair
symbolWidth double?
The pixel width of the legend item symbol. When the squareSymbol option is set, this defaults to the symbolHeight, otherwise 16.
getter/setter pair
title HighchartsLegendTitleOptions?
A title to be added on top of the legend.
getter/setter pair
useHTML bool?
Whether to use HTML to render the legend item texts.
getter/setter pair
valueDecimals double?
For a color axis with data classes, how many decimals to render in the legend. The default preserves the decimals of the range numbers.
getter/setter pair
valueSuffix String?
For a color axis with data classes, a suffix for the range numbers in the legend.
getter/setter pair
verticalAlign String?
The vertical alignment of the legend box. Can be one of top, middle or bottom. Vertical position can be further determined by the y option.
getter/setter pair
width ↔ dynamic
The width of the legend box. If a number is set, it translates to pixels. Since v7.0.2 it allows setting a percent string of the full chart width, for example 40%.
getter/setter pair
x double?
The x offset of the legend relative to its horizontal alignment align within chart.spacingLeft and chart.spacingRight. Negative x moves it to the left, positive x moves it to the right.
getter/setter pair
y double?
The vertical offset of the legend relative to it's vertical alignment verticalAlign within chart.spacingTop and chart.spacingBottom. Negative y moves it up, positive y moves it down.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJSON() String
Serializes the settings to a JSON string.
inherited
toOptionsJSON(StringBuffer buffer) → void
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited