# @salmonui/pivot-table/chart API reference

> 6 exported symbols of @salmonui/pivot-table/chart: 1 component, 2 functions, 2 interfaces and 1 type.

Canonical: https://salmonui.dev/docs/reference/pivot-table/chart

```ts
import { … } from '@salmonui/pivot-table/chart';
```

## Components

### PivotChart

Kind: component

Page: https://salmonui.dev/docs/reference/pivot-table/chart/PivotChart

```ts
function PivotChart<Row>(props: PivotChartViewProps<Row>): ReactNode;
```

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

Props: [`PivotChartViewProps`](https://salmonui.dev/docs/reference/pivot-table/chart/PivotChartViewProps) (its members are the props)

## Functions

### pivotAccumulationProps

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/chart/pivotAccumulationProps-function

```ts
function pivotAccumulationProps<Row>(pivot: PivotController<Row>, chart: PivotChartData, type: PivotChartSeriesType, options?: PivotChartPropsOptions & {
    readonly seriesId?: string | undefined;
}): PivotAccumulationProps;
```

`PieChart` / `FunnelChart` props of pivot chart data. Pie and doughnut draw
one ring per series (or only `seriesId`); funnel and pyramid draw `seriesId`,
default the first series. A click drills the pivot like a `Chart` point.

### pivotChartFamily

Kind: function

Page: https://salmonui.dev/docs/reference/pivot-table/chart/pivotChartFamily-function

```ts
function pivotChartFamily(type: PivotChartSeriesType): PivotChartFamily;
```

The chart family that draws a pivot chart type.

## Interfaces

### PivotAccumulationProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/chart/PivotAccumulationProps-interface

```ts
interface PivotAccumulationProps {
    readonly data?: PieChartProps['data'];
    readonly valueField?: string;
    readonly labelField?: string;
    readonly series?: readonly AccumulationSeries[];
    readonly innerRadius?: string;
    readonly shape?: 'funnel' | 'pyramid';
    readonly onPointClick: NonNullable<PieChartProps['onPointClick']>;
}
```

Members (7):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `data` | `readonly data?: PieChartProps['data'];` | optional |  |
| `valueField` | `readonly valueField?: string;` | optional |  |
| `labelField` | `readonly labelField?: string;` | optional |  |
| `series` | `readonly series?: readonly AccumulationSeries[];` | optional | One ring per pivot series (pie and doughnut with more than one series). |
| `innerRadius` | `readonly innerRadius?: string;` | optional |  |
| `shape` | `readonly shape?: 'funnel' \| 'pyramid';` | optional |  |
| `onPointClick` | `readonly onPointClick: NonNullable<PieChartProps['onPointClick']>;` |  |  |

### PivotChartViewProps

Kind: interface

Page: https://salmonui.dev/docs/reference/pivot-table/chart/PivotChartViewProps

```ts
interface PivotChartViewProps<Row> extends PivotChartPropsOptions {
    readonly pivot: PivotController<Row>;
    readonly seriesId?: string | undefined;
    readonly title?: string | undefined;
    readonly legend?: boolean | undefined;
    readonly tooltip?: boolean | undefined;
    readonly width?: number | undefined;
    readonly height?: number | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly fallback?: ReactNode;
    readonly chartProps?: Partial<ChartProps> | undefined;
    readonly accumulationProps?: Partial<PieChartProps & FunnelChartProps> | undefined;
    readonly ref?: Ref<ChartApi | AccumulationApi> | undefined;
}
```

Members (22):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `type` | `type?: PivotChartSeriesType;` | optional, inherited | Series type. Default `'column'`. |
| `includeTotals` | `includeTotals?: boolean;` | optional, inherited | Include subtotal and grand total members. Default false. |
| `labelSeparator` | `labelSeparator?: string;` | optional, inherited | Category member labels joined with this text for nested members. Default `' / '`. |
| `pivot` | `readonly pivot: PivotController<Row>;` |  |  |
| `seriesId` | `readonly seriesId?: string \| undefined;` | optional | Pie, doughnut, funnel, pyramid: the series to draw (`s0`, ...). |
| `title` | `readonly title?: string \| undefined;` | optional |  |
| `legend` | `readonly legend?: boolean \| undefined;` | optional |  |
| `tooltip` | `readonly tooltip?: boolean \| undefined;` | optional |  |
| `width` | `readonly width?: number \| undefined;` | optional |  |
| `height` | `readonly height?: number \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `fallback` | `readonly fallback?: ReactNode;` | optional | Shown while the chart family loads. Default none. |
| `chartProps` | `readonly chartProps?: Partial<ChartProps> \| undefined;` | optional | Extra `Chart` props (cartesian, polar and radar types). |
| `accumulationProps` | `readonly accumulationProps?: Partial<PieChartProps & FunnelChartProps> \| undefined;` | optional | Extra `PieChart` / `FunnelChart` props. |
| `ref` | `readonly ref?: Ref<ChartApi \| AccumulationApi> \| undefined;` | optional |  |
| `measure` | `measure?: string;` | optional, inherited | Measure (value field name) to chart. Default: the first value field. |
| `seriesBy` | `seriesBy?: "columns" \| "rows";` | optional, inherited | Members on the series: `'columns'` (default: one series per column member, categories are row members) or `'rows'`. |
| `drill` | `drill?: false \| PivotChartDrillMode;` | optional, inherited | Point click action (`drillChartPoint` mode). Default `'auto'`; `false` leaves clicks to `onPointClick`. |
| `onPointClick` | `onPointClick?: ((ctx: ChartPointContext, point: PivotChartPoint \| null, event: MouseEvent<Element, MouseEvent>) => void);` | optional, inherited | Called after the drill with the clicked point and its pivot cell (null when the point has none). |
| `xAxis` | `xAxis?: ChartAxisOptions;` | optional, inherited | Category axis options, merged over `{ scale: 'category' }`. |
| `yAxis` | `yAxis?: ChartAxisOptions;` | optional, inherited | Value axis options; the default title is the measure caption. |

## Types

### PivotChartFamily

Kind: type

Page: https://salmonui.dev/docs/reference/pivot-table/chart/PivotChartFamily-type

```ts
type PivotChartFamily = 'cartesian' | 'polar' | 'pie' | 'funnel';
```
