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?
optionalactions?: readonlyChartSettingsAction[]
Defined in: ui/src/chart-settings.ts:83
Buttons of the app, e.g. one that opens another dialog (see ChartSettingsAction.placement).
appearance?
optionalappearance?: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?
optionalfields?: readonlyAppSettingSection[]
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?
optionalstorage?: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?
optionalstorageKey?: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()?
optionalonOpenChange(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()?
optionalsections(defaults): readonlyChartSettingSection[]
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[]