View as Markdown

API reference: @salmonui/pivot-table/chart

PivotChartcomponent

import { PivotChart } from '@salmonui/pivot-table/chart';
function PivotChart<Row>(props: PivotChartViewProps<Row>): ReactNode;

A pivot chart of any type, drawn by the family of that type.

Props: PivotChartViewProps

PivotChart props (22)
NameSignatureDescription
typeoptionalinheritedtype?: PivotChartSeriesType;

Series type. Default 'column'.

includeTotalsoptionalinheritedincludeTotals?: boolean;

Include subtotal and grand total members. Default false.

labelSeparatoroptionalinheritedlabelSeparator?: string;

Category member labels joined with this text for nested members. Default ' / '.

pivotreadonly pivot: PivotController<Row>;
seriesIdoptionalreadonly seriesId?: string | undefined;

Pie, doughnut, funnel, pyramid: the series to draw (s0, ...).

titleoptionalreadonly title?: string | undefined;
legendoptionalreadonly legend?: boolean | undefined;
tooltipoptionalreadonly tooltip?: boolean | undefined;
widthoptionalreadonly width?: number | undefined;
heightoptionalreadonly height?: number | undefined;
classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;
fallbackoptionalreadonly fallback?: ReactNode;

Shown while the chart family loads. Default none.

chartPropsoptionalreadonly chartProps?: Partial<ChartProps> | undefined;

Extra Chart props (cartesian, polar and radar types).

accumulationPropsoptionalreadonly accumulationProps?: Partial<PieChartProps & FunnelChartProps> | undefined;

Extra PieChart / FunnelChart props.

refoptionalreadonly ref?: Ref<ChartApi | AccumulationApi> | undefined;
measureoptionalinheritedmeasure?: string;

Measure (value field name) to chart. Default: the first value field.

seriesByoptionalinheritedseriesBy?: "columns" | "rows";

Members on the series: 'columns' (default: one series per column member, categories are row members) or 'rows'.

drilloptionalinheriteddrill?: false | PivotChartDrillMode;

Point click action (drillChartPoint mode). Default 'auto'; false leaves clicks to onPointClick.

onPointClickoptionalinheritedonPointClick?: ((ctx: ChartPointContext, point: PivotChartPoint | null, event: MouseEvent<Element, MouseEvent>) => void);

Called after the drill with the clicked point and its pivot cell (null when the point has none).

xAxisoptionalinheritedxAxis?: ChartAxisOptions;

Category axis options, merged over { scale: 'category' }.

yAxisoptionalinheritedyAxis?: ChartAxisOptions;

Value axis options; the default title is the measure caption.