charton API / @chart-on/ui / index / ChartGrid
Interface: ChartGrid
Defined in: ui/src/grid.ts:103
A grid of chart shells made by createChartGrid: its cells and charts, the active cell, layout and sizes, the link group, theme, saved layouts and events.
Properties
active
readonlyactive:ChartShell
Defined in: ui/src/grid.ts:122
The cell the toolbar acts on.
activeIndex
readonlyactiveIndex:number
Defined in: ui/src/grid.ts:123
cells
readonlycells: readonlyChartShell[]
Defined in: ui/src/grid.ts:107
The shell in each cell, by row.
charts
readonlycharts: readonlyChart[]
Defined in: ui/src/grid.ts:108
el
el:
HTMLElement
Defined in: ui/src/grid.ts:104
layout
readonlylayout:ChartGridLayout
Defined in: ui/src/grid.ts:111
links
readonlylinks:LinkGroup
Defined in: ui/src/grid.ts:110
Keeps the charts in step; every cell is in it.
sizes
readonlysizes:ChartGridSizes
Defined in: ui/src/grid.ts:118
theme
readonlytheme:ShellTheme
Defined in: ui/src/grid.ts:126
toolbar
readonlytoolbar:ToolbarHandle|null
Defined in: ui/src/grid.ts:105
Methods
destroy()
destroy():
void
Defined in: ui/src/grid.ts:139
Returns
void
loadLayout()
loadLayout(
data,options?):ChartGridLoadResult
Defined in: ui/src/grid.ts:136
Restore a grid from serializeLayout. Invalid parts are skipped and listed in errors; a missing sizes list means equal sizes. Throws, changing nothing, when data is not a saved grid or a new chart cannot be created.
Parameters
data
unknown
options?
Returns
on()
on<
K>(event,listener): () =>void
Defined in: ui/src/grid.ts:138
Subscribe to grid events; returns an unsubscribe function.
Type Parameters
K
K extends keyof ChartGridEvents
Parameters
event
K
listener
(payload) => void
Returns
() => void
serializeLayout()
serializeLayout(
options?):ChartGridState
Defined in: ui/src/grid.ts:130
The grid to store and restore with loadLayout. options go to each chart's serializeLayout.
Parameters
options?
Returns
setActive()
setActive(
index,options?):void
Defined in: ui/src/grid.ts:125
Make a cell active; with focus, also move keyboard focus to its chart.
Parameters
index
number
options?
focus?
boolean
Returns
void
setLayout()
setLayout(
layout):void
Defined in: ui/src/grid.ts:117
Switch preset. Cells past the new count are destroyed from the end, new ones are created with the cell options, and the sizes are reset. Throws, keeping the previous layout, when a new chart cannot be created.
Parameters
layout
Returns
void
setSizes()
setSizes(
sizes):void
Defined in: ui/src/grid.ts:120
Set column widths and row heights; lists of the wrong length are ignored, the rest are scaled to sum to 1.
Parameters
sizes
Partial<ChartGridSizes>
Returns
void
setTheme()
setTheme(
theme):void
Defined in: ui/src/grid.ts:128
Switch the grid and every cell to theme.
Parameters
theme
Returns
void