Skip to content

charton API


charton API / @chart-on/core / index / LegendOptions

Interface: LegendOptions ​

Defined in: packages/core/src/legend.ts:17

The legend chart option in object form.

Properties ​

background? ​

optional background?: boolean | "auto"

Defined in: packages/core/src/legend.ts:45

A translucent panel of the chart background behind each pane's rows, so they stay legible over dense content. 'auto' (default) on panes that show a heatmap, true on every pane, false on none (the text keeps its halo either way).


changeArrows? ​

optional changeArrows?: boolean

Defined in: packages/core/src/legend.ts:33

An up or down arrow before each change value, so the direction does not rest on the up and down colours alone. Default false.


formatter? ​

optional formatter?: (entry, series) => LegendEntry

Defined in: packages/core/src/legend.ts:57

Change a row before it is shown, e.g. to add units; also used by screenshots and valuesAt. If it throws, the row is shown unformatted and the error logged once.

Parameters ​

entry ​

LegendEntry

series ​

Series

Returns ​

LegendEntry


hiddenSeries? ​

optional hiddenSeries?: "dimmed" | "omit"

Defined in: packages/core/src/legend.ts:52

Rows of hidden series: 'dimmed' (default) keeps them, dimmed, with an eye button to show them again; 'omit' leaves them out of the legend, its height, valuesAt() legend rows and screenshots, so the app shows them again through setVisible or its own UI.


mode? ​

optional mode?: LegendMode

Defined in: packages/core/src/legend.ts:23

'full' (default) every value, 'compact' the close or value only, 'title' titles only.


position? ​

optional position?: LegendPosition

Defined in: packages/core/src/legend.ts:21

Corner of each pane. Default 'top-start'.


showChange? ​

optional showChange?: boolean

Defined in: packages/core/src/legend.ts:28

Every candle series row: the change and percent change from the previous close (with Heikin-Ashi, the previous Heikin-Ashi close). Default true.


visible? ​

optional visible?: boolean

Defined in: packages/core/src/legend.ts:19

Same as features.legend.


whenIdle? ​

optional whenIdle?: "hidden" | "last"

Defined in: packages/core/src/legend.ts:38

Without a crosshair: 'last' (default) shows the newest bar's values, 'hidden' titles only (also in valuesAt() legend rows).