API reference: @salmonui/charts/pie-chart
PieChartcomponent
import { PieChart } from '@salmonui/charts/pie-chart';function PieChart(props: PieChartProps): ReactNode;
Props: PieChartProps
| Name | Signature | Description |
|---|---|---|
textoptional | readonly text?: Partial<PieChartText> | undefined; | Built-in text (over the nearest |
seriesoptional | readonly series?: readonly AccumulationSeries[] | undefined; | Concentric rings, inner to outer; overrides |
radiusoptional | readonly radius?: number | string | undefined; | Outer radius: px or a percent of the half of the shorter side ( |
innerRadiusoptional | readonly innerRadius?: number | string | undefined; | Doughnut hole: px, or a percent of the radius ( |
centeroptional | readonly center?: {
readonly x?: number | string | undefined;
readonly y?: number | string | undefined;
} | undefined; | Center as percents of the plot ( |
startAngleoptional | readonly startAngle?: number | undefined; | Degrees clockwise from 12 o'clock. Default 0 and 360. |
endAngleoptional | readonly endAngle?: number | undefined; | |
padAngleoptional | readonly padAngle?: number | undefined; | Gap between slices, degrees. |
explodeoptional | readonly explode?: boolean | {
readonly offset?: number | undefined;
readonly all?: boolean | undefined;
} | undefined; | Explosion: offset px (default 10) and |
explodedPointsoptional | readonly explodedPoints?: readonly number[] | undefined; | |
defaultExplodedPointsoptional | readonly defaultExplodedPoints?: readonly number[] | undefined; | |
onExplodedPointsChangeoptional | readonly onExplodedPointsChange?: ((exploded: readonly number[], event: AccumulationChangeEvent) => void) | undefined; | |
groupSmalloptional | readonly groupSmall?: {
readonly threshold: number;
readonly by?: 'value' | 'count' | undefined;
readonly label?: string | undefined;
} | undefined; | Merge small slices into one "Others" slice. |
labelsoptional | readonly labels?: boolean | {
readonly position?: PieLabelPosition | undefined;
readonly connector?: 'line' | 'curve' | undefined;
readonly maxWidth?: number | undefined;
} | undefined; | |
centerLabeloptional | readonly centerLabel?: ReactNode | ((context: {
readonly point: AccumulationPoint | null;
readonly total: number;
}) => ReactNode); | Doughnut center content; a function receives the hovered or focused point (null at rest). |
sizeoptional | readonly size?: 'small' | 'default' | undefined; |
|
dataoptionalinherited | data?: readonly unknown[]; | Records, or numbers (labels then default to "1", "2", ...). |
valueFieldoptionalinherited | valueField?: string; | |
labelFieldoptionalinherited | labelField?: string; | |
colorFieldoptionalinherited | colorField?: string; | Record field holding a data color ( |
paletteoptionalinherited | palette?: readonly string[]; | Data colors by point index; default the derived |
patternsoptionalinherited | patterns?: boolean; | Overlay one system fill pattern per palette slot (non-color encoding). |
emptyPointsoptionalinherited | emptyPoints?: "average" | "drop" | "zero"; | |
widthoptionalinherited | width?: number; | |
heightoptionalinherited | height?: number; | |
titleoptionalinherited | title?: string; | |
subtitleoptionalinherited | subtitle?: string; | |
descriptionoptionalinherited | description?: string; | Accessible description; default the automatic summary. |
localeoptionalinherited | locale?: string; | |
formatoptionalinherited | format?: NumberFormatOptions | ((value: number) => string); | |
legendoptionalinherited | legend?: boolean | AccumulationLegendOptions; | |
tooltipoptionalinherited | tooltip?: boolean | AccumulationTooltipOptions; | |
highlightoptionalinherited | highlight?: boolean; | Dim the other points while one is hovered or focused. Default true. |
selectionoptionalinherited | selection?: boolean | { readonly multiple?: boolean | undefined; }; | Click and Enter select points. |
hiddenPointsoptionalinherited | hiddenPoints?: readonly number[]; | |
defaultHiddenPointsoptionalinherited | defaultHiddenPoints?: readonly number[]; | |
onHiddenPointsChangeoptionalinherited | onHiddenPointsChange?: ((hidden: readonly number[], event: AccumulationChangeEvent) => void); | |
selectedPointsoptionalinherited | selectedPoints?: readonly AccumulationPointRef[]; | |
defaultSelectedPointsoptionalinherited | defaultSelectedPoints?: readonly AccumulationPointRef[]; | |
onSelectedPointsChangeoptionalinherited | onSelectedPointsChange?: ((selected: readonly AccumulationPointRef[], event: AccumulationChangeEvent) => void); | |
annotationsoptionalinherited | annotations?: readonly AccumulationAnnotation[]; | |
getPointStyleoptionalinherited | getPointStyle?: ((point: AccumulationPoint) => AccumulationPointStyle | undefined); | |
formatLabeloptionalinherited | formatLabel?: ((point: AccumulationPoint) => string); | |
onPointClickoptionalinherited | onPointClick?: ((point: AccumulationPoint, event: AccumulationChangeEvent) => void); | |
onPointHoveroptionalinherited | onPointHover?: ((point: AccumulationPoint | null) => void); | |
showDataTableoptionalinherited | showDataTable?: boolean; | Visible accessible data table ( |
accessibleTableoptionalinherited | accessibleTable?: boolean; |
|
renderEmptyoptionalinherited | renderEmpty?: (() => ReactNode); | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
idoptionalinherited | id?: string; | |
refoptionalinherited | ref?: Ref<VizInstance>; | |
onResizeoptionalinherited | onResize?: ((size: { readonly width: number; readonly height: number; }) => void); | |
animatedoptionalinherited | animated?: boolean; | Entrance and update transitions, default |