@kanunilabs/pivotgrid-react-enterprise
@kanunilabs/pivotgrid-react-enterprise / ChartFactoryProps
Interface: ChartFactoryProps
Properties
animate?
optionalanimate?: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?
optionalbins?: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?
optionalcountLabel?:string
histogram: the value axis title when format names none. Default 'Count'; pass the grid's word.
data
data:
any[]
defaultHiddenSeries?
optionaldefaultHiddenSeries?: readonlystring[]
fields?
optionalfields?: readonlyPivotField<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?
optionalformat?: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?
optionalheight?:number
hiddenSeries?
optionalhiddenSeries?: readonlystring[]
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?
optionallocale?:string
onCategoryClick?
optionalonCategoryClick?: (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
Returns
void
onHiddenSeriesChange?
optionalonHiddenSeriesChange?: (keys) =>void
Each legend click, with the keys hidden after it (sorted).
Parameters
keys
string[]
Returns
void
palette?
optionalpalette?: readonlystring[] |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?
optionalrangeNeedsTwoText?: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?
optionalstacking?: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?
optionaltotalLabel?:string
Caption of the waterfall's closing bar. Default 'Total'; pass the grid's word.
type
type:
ChartType
width?
optionalwidth?: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?
optionalxyNeedsMeasuresText?: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.