Skip to content

charton API


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

Interface: ChartSettingsOptions ​

Defined in: ui/src/chart-settings.ts:68

Options for createChartSettings: the sections shown, where changed settings are saved, the appearance that takes color edits, and an open/close callback.

Properties ​

actions? ​

optional actions?: readonly ChartSettingsAction[]

Defined in: ui/src/chart-settings.ts:83

Buttons of the app, e.g. one that opens another dialog (see ChartSettingsAction.placement).


appearance? ​

optional appearance?: AppearanceHandle | null

Defined in: ui/src/chart-settings.ts:100

Appearance overrides that theme colors and grid lines are saved as, so they survive a dark/light switch. Default the chart's (appearanceOf); null applies them as plain options.


fields? ​

optional fields?: readonly AppSettingSection[]

Defined in: ui/src/chart-settings.ts:81

Sections of fields the app reads and writes itself (see AppSettingField), after the option sections. Edits apply live and Cancel restores them, but they are not saved to storage and "Reset to defaults" leaves them alone: the app keeps them.


storage? ​

optional storage?: ChartSettingsStorage | null

Defined in: ui/src/chart-settings.ts:89

Where changed settings are kept; null keeps them for this visit only. Default localStorage. Theme colors and grid lines go to appearance instead while there is one.


storageKey? ​

optional storageKey?: string

Defined in: ui/src/chart-settings.ts:94

localStorage key of the default storage. Default 'charton:settings'. Give each chart on a page its own key, or they share one set of settings.

Methods ​

onOpenChange()? ​

optional onOpenChange(open): void

Defined in: ui/src/chart-settings.ts:102

Called when the dialog opens or closes, e.g. to refresh a toolbar button's pressed state.

Parameters ​

open ​

boolean

Returns ​

void


sections()? ​

optional sections(defaults): readonly ChartSettingSection[]

Defined in: ui/src/chart-settings.ts:74

The sections to show, given the built-in ones (chartSettingsSchema): return them filtered, reordered or with sections, groups and fields of your own. Any chart option path works as a field.

Parameters ​

defaults ​

readonly ChartSettingSection[]

Returns ​

readonly ChartSettingSection[]