Skip to main content

LegendSpec

@elastic/chartsExports


@elastic/charts / LegendSpec

Interface: LegendSpec

The legend configuration

Contents

Extended By

Properties

customLegend?

customLegend?: CustomLegend

Override the legend with a custom component.

Source

packages/charts/src/specs/settings.tsx:507


flatLegend?

flatLegend?: boolean

Display the legend as a flat list.

Default Value

false

Source

packages/charts/src/specs/settings.tsx:479


legendAction?

legendAction?: LegendAction

Render slot to render action for legend

Source

packages/charts/src/specs/settings.tsx:493


legendActionOnHover?

legendActionOnHover?: boolean

Display the legend action only on hover. When false, the action is always visible.

Default Value

false

Source

packages/charts/src/specs/settings.tsx:498


legendColorPicker?

legendColorPicker?: LegendColorPicker

Source

packages/charts/src/specs/settings.tsx:499


legendLayout?

legendLayout?: LegendLayout

The layout of the legend

When undefined, the grid list layout is used if there are no aggregated values or the only value is CurrentAndLastValue; otherwise the table layout is shown.

When 'list', the grid list layout is used instead if the legend position is left/right or the legend direction is vertical.

Default Value

undefined

Source

packages/charts/src/specs/settings.tsx:454


legendMaxDepth

legendMaxDepth: number

Limit the legend to the specified maximal depth when showing a hierarchical legend

Remarks

This is not the max depth, but the number of level shown: 0 none, 1 first, 2 up to the second etc. See https://github.com/elastic/elastic-charts/issues/1981 for details

Source

packages/charts/src/specs/settings.tsx:467


legendPosition

legendPosition: Position | LegendPositionConfig

Set legend position

Default Value

Position.Right

Source

packages/charts/src/specs/settings.tsx:443


legendSize

legendSize: number

Sets the exact legend width (vertical) or height (horizontal)

Limited to max of 70% of the chart container dimension Vertical legends limited to min of 30% of computed width

Source

packages/charts/src/specs/settings.tsx:474


legendSort?

legendSort?: SeriesCompareFn

A SeriesSortFn to sort the legend values (top-bottom)

Source

packages/charts/src/specs/settings.tsx:503


legendStrategy?

legendStrategy?: LegendStrategy

Choose a partition highlighting strategy for hovering over legend items.

Default Value

LegendStrategy.Path

Source

packages/charts/src/specs/settings.tsx:484


legendTitle?

legendTitle?: string

a title for the table legend

Source

packages/charts/src/specs/settings.tsx:511


legendValues

legendValues: LegendValue[]

Add one or more computed statistics to each legend item. The available statistics depends by chart type.

Source

packages/charts/src/specs/settings.tsx:459


onLegendItemClick?

onLegendItemClick?: LegendItemListener

Source

packages/charts/src/specs/settings.tsx:487


onLegendItemMinusClick?

onLegendItemMinusClick?: LegendItemListener

Source

packages/charts/src/specs/settings.tsx:489


onLegendItemOut?

onLegendItemOut?: BasicListener

Source

packages/charts/src/specs/settings.tsx:486


onLegendItemOver?

onLegendItemOver?: LegendItemListener

Source

packages/charts/src/specs/settings.tsx:485


onLegendItemPlusClick?

onLegendItemPlusClick?: LegendItemListener

Source

packages/charts/src/specs/settings.tsx:488


showLegend

showLegend: boolean

Show the legend

Default Value

false

Source

packages/charts/src/specs/settings.tsx:438


Generated using typedoc-plugin-markdown and TypeDoc