Legend
configurationThe chart legend configuration options.
The colors assigned to individual points are not reflected in the legend for series-based charts (e.g. column, line, bar). The legend items are tied to the series, not to individual points, except in cases like pie or donut charts where each point has a dedicated legend item.
legend
Objectlegend.align
StringThe legend horizontal alignment when the legend.position is "top" or "bottom" and the vertical alignment when the legend.position is "left" or "right".
The supported values are:
-
"start" - the legend is aligned to the start.
-
"center" - the legend is aligned to the center.
-
"end" - the legend is aligned to the end.
Default: "center"
legend.background
StringThe background color of the legend. Accepts a valid CSS color string, including hex and rgb.
Default: "white"
legend.border
ObjectThe border of the legend.
legend.focusHighlight
ObjectThe legend focus highlight configuration options.
legend.height
NumberThe legend height when the legend.orientation is set to "vertical".
legend.inactiveItems
ObjectThe chart inactive legend items configuration.
legend.item
ObjectThe configuration of the Chart legend item.
To override the marker configuration of individual series, use the series.legendItem settings of the series.
legend.labels
ObjectThe chart legend label configuration.
legend.margin
Number|ObjectThe margin of the chart legend. A numeric value will set all paddings.
Default: 5
legend.offsetX
NumberThe X offset of the chart legend. The offset is relative to the default position of the legend. For instance, a value of 20 will move the legend 20 pixels to the right of its initial position. A negative value will move the legend to the left of its current position.
Default: 0
legend.offsetY
NumberThe Y offset of the chart legend. The offset is relative to the current position of the legend. For instance, a value of 20 will move the legend 20 pixels down from its initial position. A negative value will move the legend upwards from its current position.
Default: 0
legend.orientation
StringThe orientation of the legend items.
The supported values are:
-
"vertical" - the legend items are added vertically.
-
"horizontal" - the legend items are added horizontally.
Default: "vertical"
legend.padding
Number|ObjectThe padding of the chart legend. A numeric value will set all paddings.
Default: 5
legend.position
StringThe positions of the chart legend.
The supported values are:
-
"top" - the legend is positioned on the top.
-
"bottom" - the legend is positioned on the bottom.
-
"left" - the legend is positioned on the left.
-
"right" - the legend is positioned on the right.
-
"custom" - the legend is positioned using legend.offsetX and legend.offsetY.
Default: "right"
legend.reverse
BooleanIf set to true the legend items will be reversed.
Available in versions 2013.3.1306 and later.
Default: false
legend.spacing
NumberThe spacing between the labels in pixels when the legend.orientation is "horizontal".
legend.title
ObjectThe legend title configuration options or text.
legend.visible
BooleanIf set to true the chart will display the legend. By default the chart legend is visible.
Default: true
legend.width
NumberThe legend width when the legend.orientation is set to "horizontal".