Skip to content

charton API


charton API / @chart-on/ui / index / IntervalsPresetOptions

Interface: IntervalsPresetOptions ​

Defined in: ui/src/toolbar-presets.ts:48

Options for the intervals preset: its id and label, button row or menu, the starting value, interval text, and how a picked interval is applied.

Properties ​

display? ​

optional display?: "menu" | "segmented"

Defined in: ui/src/toolbar-presets.ts:54

A row of buttons (default, collapses into a menu when narrow) or always a menu.


format? ​

optional format?: (interval) => string

Defined in: ui/src/toolbar-presets.ts:62

Text for each interval. Default the interval itself, e.g. 15m, and for trade and volume intervals text in the chart's language, e.g. "100 trades" and "5K volume".

Parameters ​

interval ​

Interval

Returns ​

string


id? ​

optional id?: string

Defined in: ui/src/toolbar-presets.ts:50

Default 'interval'.


label? ​

optional label?: string

Defined in: ui/src/toolbar-presets.ts:52

Accessible name. Default 'Interval'.


onChange? ​

optional onChange?: (interval, chart) => void

Defined in: ui/src/toolbar-presets.ts:67

Switch to the picked interval. Default: reload the data source's current symbol at it (chart.setSymbol); does nothing before the first setSymbol.

Parameters ​

interval ​

Interval

chart ​

Chart

Returns ​

void


value? ​

optional value?: Interval

Defined in: ui/src/toolbar-presets.ts:56

Shown before the chart has loaded anything. Default the first entry.