Documentation

@kanunilabs/datagrid-enterprise


@kanunilabs/datagrid-enterprise / ChartingOptions

Interface: ChartingOptions

Properties

axisLabelFormatter?

optional axisLabelFormatter?: ChartAxisLabelFormatter

Write the tick labels of both axes yourself (§E.4 #56): called once per label with the raw value (params.value — a number on a value axis, the category or a group's lower bound on a category axis) and the text the chart would print (params.text, after the number and date format settings). Return params.text to keep the default. A function, so it lives here and not in the chart's state: a saved view and getState() stay plain data. One that throws keeps that label at its default.


container?

optional container?: HTMLElement

Put the chart in this element instead of docking it above the grid — a dashboard tile, a side panel (rival analysis, charts §E.1 #11). Everything that opens the chart (the toolbar button, the menus, the API) opens it there; "Pop out" and extra windows float inside it. The grid's theme comes along: the panel sits in a box carrying the grid's theme classes.


crossFilter?

optional crossFilter?: boolean

Clicking a category filters the grid by it; clicking it again, or the chart's background, clears it. Ctrl/Cmd-click adds a category or takes it out again — the grid then shows the rows of ANY picked category, and the chart keeps every category on screen to pick from. Off by default — surprising.


defaultFormat?

optional defaultFormat?: ChartFormat

Title, axis titles, legend position and data labels to open with — what the panel's Format editor edits. onFormatChange reports each change so an app can keep it (plain data).


defaultOpen?

optional defaultOpen?: boolean

Dock the panel already open instead of waiting for the toolbar button.


defaultSpec?

optional defaultSpec?: Partial<ChartSpec<GridRowData>>

Open with this configuration instead of the first text/number columns.


defaultStacking?

optional defaultStacking?: ChartStacking

Series layout to open on — 'grouped' (default), 'stacked' or 'normalized' (100%). Applies to column, bar, line and area; the user can change it from the panel.


defaultType?

optional defaultType?: string

Chart type to open on — a registered type id ('column' by default, 'scatter', 'bubble', a type of your own…). The panel's picker changes it afterwards.


enabled?

optional enabled?: boolean


floating?

optional floating?: boolean | FrameRect

Open as a window floating over the grid instead of docked above it — true for a centred window, or a rectangle (px, relative to the grid). The panel's own button moves it between the two either way (§E.1 #9).


height?

optional height?: number

Docked canvas height in px. Default 280.


labels?

optional labels?: Record<string, string>

Rename the built-in strings for THIS grid — the React option, same shape. Merged over the locale's dictionary, so a partial object renames what it names and leaves the rest translated.

It belongs here, on the CONFIG, because that is where createEnterpriseGrid reads it. It was declared on ChartOpenSeed instead, which meant the one spelling that works — charting: { labels: … } — did not type-check (TS2353), while the spelling that did type-check was never read by open(). Both halves wrong, in opposite directions, in the release whose purpose was removing options that are accepted and ignored.


onFormatChange?

optional onFormatChange?: (format) => void

Parameters

format

ChartFormat

Returns

void