import { PieLegend } from '@wick-charts/react'; <PieLegend seriesId='pie'> {({ slices, mode, format }) => ( <ul>{slices.map(s => <li key={s.label}>{s.label}: {format(s.value)}</li>)}</ul> )}</PieLegend>Companion to <PieSeries> — renders slice labels with their value or percent, anchored to one of three positions (bottom, right, overlay).
Companion to <PieSeries> — renders slice labels with their value or percent, anchored to one of three positions (bottom, right, overlay).
Owning series id. Optional — when omitted, the first visible pie series is picked.
Default: 'both'. See PieLegendMode.
Custom formatter for the absolute slice value. Default: shared formatCompact.
Layout placement. Default: 'bottom'. See PieLegendPosition.
Render-prop escape hatch. Receives slices + mode + format, replaces default UI.
// children: (ctx: PieLegendRenderContext) => ReactNode<PieLegend> {({ slices, mode, format }) => ( <ul>{slices.map(s => <li key={s.label}>{s.label}: {format(s.value)}</li>)}</ul> )}</PieLegend>