Skip to content

charton API


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

Interface: ChartGridOptions ​

Defined in: ui/src/grid.ts:43

Options for createChartGrid: the starting layout, each cell's shell options and setup, the grid toolbar, what the charts keep in step, and the theme.

Properties ​

cell? ​

optional cell?: ChartShellOptions | ((index) => ChartShellOptions)

Defined in: ui/src/grid.ts:52

Shell options of each cell, or a function of the cell's index (0 to 7, by row). Cells draw through the shared WebGL context (chart: { gl: 'shared' }) unless set otherwise, so eight charts take one context of the page's budget. The grid adds the sharedContext() plugin to a cell's own chart.plugins list.


className? ​

optional className?: string

Defined in: ui/src/grid.ts:68

Extra class names for theming.


layout? ​

optional layout?: ChartGridLayout

Defined in: ui/src/grid.ts:45

Preset to start with. Default 1x1.


optional link?: false | Partial<LinkGroupOptions>

Defined in: ui/src/grid.ts:64

What the charts keep in step (see createLinkGroup). Defaults to the link group defaults; false links nothing. Change it later through grid.links.


setup? ​

optional setup?: (shell, index) => void | (() => void)

Defined in: ui/src/grid.ts:57

Called for each cell once its shell exists, also for cells a later setLayout adds: load data here. A returned function runs when the cell goes.

Parameters ​

shell ​

ChartShell

index ​

number

Returns ​

void | (() => void)


theme? ​

optional theme?: ShellTheme

Defined in: ui/src/grid.ts:66

Colour scheme of the grid and of cells that set none. Default dark.


toolbar? ​

optional toolbar?: ToolbarItem[] | ToolbarOptions

Defined in: ui/src/grid.ts:59

Toolbar above the grid; items or customization options acting on the active chart. Omit or pass [] for none.