DevExtreme v23.1 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Legend

Specifies the properties of a chart's legend.

import { Legend } from "devextreme/viz/chart"

customizeHint

Specifies the text for a hint that appears when a user hovers the mouse pointer over a legend item.

Type:

Function

Function parameters:
seriesInfo:

Object

Information on the series.

Object structure:
Name Type Description
seriesColor

String

The series' color.

seriesIndex

Number

The index of the series in the series array. To get the Series object by this index, call the getSeriesByPos(seriesIndex) method.

seriesName any

The series' name. To get the Series object by this name, call the getSeriesByName(seriesName) method.

Return Value:

String

The text for the hint to display.

customizeText

Specifies a callback function that returns the text to be displayed by a legend item.

Type:

Function

Function parameters:
seriesInfo:

Object

Information on the series.

Object structure:
Name Type Description
seriesColor

String

The series' color.

seriesIndex

Number

The series' index.

seriesName any

The series' name.

Return Value:

String

The text for the legend item to display.

Cannot be used in themes.

hoverMode

Specifies what series elements to highlight when a corresponding item in the legend is hovered over.

Default Value: 'includePoints'

position

Specifies whether the legend is located outside or inside the chart's plot.

Default Value: 'outside'