Pie
Examples
API Reference
Types come from the public API. A dash indicates no default is documented here.
PieChart props
Public source| Prop | Type | Default | Description |
|---|---|---|---|
key | KeepAliveKey<K, Ends> | undefined | '' | The child's identity among its parent's children of one component, or a kept child's among its author's. The empty string by default. |
onEmit | Show type((events: { readonly _tag: "HoverChanged"; readonly index: number | null; }) => NoInfer<Msg> | undefined) | { readonly HoverChanged: (event: { readonly _tag: "HoverChanged"; readonly index: number | null; }) => NoInfer<Msg> | undefined; } | undefined | — | Handle the child's events with a callback, or supply one handler per tag for tagged events. Return a parent message to dispatch it, or `undefined` to ignore the event. |
props.data | Show typereadonly { readonly label: string; readonly value: number; readonly fill?: string; readonly color?: string; }[] | Required | |
props.id | string | Required | |
props.style | { readonly [x: string]: string | number; } | — | |
props.size | number | — | |
props.className | string | '' | |
props.ariaLabel | string | (chart.family === 'pie' ? 'Pie chart' : 'Ring chart') | |
props.ariaDescription | string | — | |
props.enterTransition | Show type{ readonly delay?: number; readonly duration?: number; readonly ease?: string | readonly number[] | readonly (string | readonly number[])[]; readonly type?: unknown; readonly stiffness?: number; readonly damping?: number; readonly mass?: number; readonly bounce?: number; } | — | |
props.hoveredIndex | number | null | null | |
props.startAngle | number | — | |
props.endAngle | number | — | |
props.enterStaggerScale | number | — | |
props.geometryScrubbing | boolean | — | |
props.cornerRadius | number | — | |
props.innerRadius | number | 0 | |
props.padAngle | number | — | |
props.hoverOffset | number | — | |
props.slices | Show typereadonly { readonly index: number; readonly animate?: boolean; readonly fill?: string; readonly color?: string; readonly className?: string; readonly hoverOffset?: number; readonly showGlow?: boolean; readonly hoverEffect?: "grow" | "translate" | "none"; }[] | [] | |
props.centers | Show typereadonly { readonly prefix?: string; readonly className?: string; readonly suffix?: string; readonly defaultLabel?: string; readonly formatOptions?: { readonly style?: "decimal" | "percent" | "currency"; readonly currency?: string; readonly unit?: string; readonly maximumFractionDigits?: number; readonly notation?: "compact" | "standard"; readonly compactDisplay?: "long" | "short"; readonly minimumFractionDigits?: number; readonly minimumIntegerDigits?: number; readonly minimumSignificantDigits?: number; readonly maximumSignificantDigits?: number; readonly currencyDisplay?: "symbol" | "code" | "name" | "narrowSymbol"; readonly unitDisplay?: "long" | "short" | "narrow"; }; readonly labelClassName?: string; readonly valueClassName?: string; }[] | [] | |
props.resources | Show typereadonly { readonly id: string; readonly stops: readonly { readonly color: string; readonly offset: string; readonly opacity?: number; }[]; readonly x1?: string; readonly y1?: string; readonly x2?: string; readonly y2?: string; }[] | [] |