Documentation

@kanunilabs/pivotgrid-react-enterprise


@kanunilabs/pivotgrid-react-enterprise / ChartFactoryProps

Interface: ChartFactoryProps

Properties

animate?

optional animate?: boolean

recharts' entry animation (marks grow in). Default true, as before. Off suits a dashboard that redraws often, a print or image capture taken right after mount, and tests.


bins?

optional bins?: number

histogram: about how many bars the first visible series' values are cut into — round-width bins, so the edges read as 0, 500, 1,000. Default 10.


countLabel?

optional countLabel?: string

histogram: the value axis title when format names none. Default 'Count'; pass the grid's word.


data

data: any[]


defaultHiddenSeries?

optional defaultHiddenSeries?: readonly string[]


fields?

optional fields?: readonly PivotField<any, PivotCellTemplate, any>[]

The grid's fields. With them, tooltips and data labels print each series the way its measure prints in the grid (the field's format); without them, the locale's number format.


format?

optional format?: ChartFormat

Title, axis titles, legend position and data labels — the shape the PivotGrid and DataGrid chart panels edit (ChartFormat). The title is drawn above the chart; with a fixed height the chart takes what is left.


height?

optional height?: number


hiddenSeries?

optional hiddenSeries?: readonly string[]

Series switched off in the legend, by dataKey. Pass it together with onHiddenSeriesChange to own the state — and keep it with the rest of a saved chart, as the vanilla panel's getChartState does. Leave it out and the factory keeps the state itself, starting from defaultHiddenSeries.


locale?

optional locale?: string


onCategoryClick?

optional onCategoryClick?: (category) => void

A click on a category's mark — a bar, a slice, a dot-plot point, a waterfall / funnel / treemap / heatmap shape — with the row values behind it (path, from the transformer's argPath; empty for the grand total). Filter the pivot with it, e.g. path.forEach((p) => controller.applyFilter(p.fieldId, new Set([p.value]), 'include')). Lines and areas have no mark to click, as in the DataGrid chart.

Parameters

category

ChartCategory

Returns

void


onHiddenSeriesChange?

optional onHiddenSeriesChange?: (keys) => void

Each legend click, with the keys hidden after it (sorted).

Parameters

keys

string[]

Returns

void


palette?

optional palette?: readonly string[] | ChartPaletteName

Series colours. A list is used in order; 'theme' derives them from the --pivot-primary the factory's container inherits (wrap it in the grid's theme, or set the variable yourself) — the ramp the DataGrid and the JavaScript PivotGrid chart use, so series one IS the accent. Without it, the colours the transformer gave. Pie slices and treemap cells follow it.

A palette NAME — 'classic', 'colorblind', 'vivid', 'monochrome' (charts §E.4 #54) — picks a fixed set whose colours keep 3:1 against the --pivot-surface the container inherits. format.palette and format.colors win over this prop: they are the chart's saved choice.


rangeNeedsTwoText?

optional rangeNeedsTwoText?: string

Shown by rangeBar when the pivot has one measure (a range needs a low and a high). The factory has no dictionary of its own; pass the grid's words.


series

series: ChartSeriesDef[]


stacking?

optional stacking?: ChartStacking

Series layout for column, bar, line and area: side by side (grouped, the default), on top of one another (stacked), or as shares of each category's total (normalized, 100%). Other types ignore it.


totalLabel?

optional totalLabel?: string

Caption of the waterfall's closing bar. Default 'Total'; pass the grid's word.


type

type: ChartType


width?

optional width?: number

Fixed size in px. Omit both to fill the parent (the default).

Filling relies on recharts' ResponsiveContainer, which measures through a ResizeObserver — so a chart that starts inside a hidden tab or a collapsed panel draws nothing until it is shown. A fixed size draws immediately.


xyNeedsMeasuresText?

optional xyNeedsMeasuresText?: string

Shown by xy/bubble when the pivot has too few measures to pair. The factory has no dictionary of its own; pass the grid's word here.