2.0 alpha
These docs describe 2.0. Install it with @once-ui-system/core@alpha.
On 1.8.x? Read the 1.x docs
TrademarkTrademarkDocs
Ctrl k
Search docs...
Data

PieChart

Updated: May 14, 2025
View on GitHub
The PieChart component provides a way to display pie charts with interactive features, including hover effects, click events, and custom styling options. It supports various customization options including different chart types, color schemes, and interactive features.
ring sets the inner and outer radius as percentages of the available space. inner: 0 is a solid pie; anything above it is a donut, and the hole is where a total or a label goes. Keep outer under 100 — the arc is drawn inside the panel, and a value at 100 leaves no room for the labels around it. A pie reads two fields per row: the number that sizes the slice and the string that names it. Those default to value and name, and dataKey / nameKey point them at different fields when your data is already shaped some other way. origo moves the centre of the pie within the panel, as percentages. Shift it when the legend sits along one side and the default centring leaves the arc crowded against it. PieChart has no axes or grid, so axis and grid do not apply.
Prop
Type
Default
ring
Inner and outer radius as percentages. inner: 0 is a solid pie.
{ inner: number; outer: number }{ inner: 0, outer: 80 }
dataKey
Field holding the number that sizes each slice.
stringvalue
nameKey
Field holding the slice label.
stringname
origo
Centre of the pie within the panel, as percentages.
{ x: number; y: number }{ x: 50, y: 50 }
legend
Legend position and visibility.
LegendConfig{}
error
Render the error state instead of the chart.
booleanfalse
tooltip
Show a tooltip on hover.
booleantrue
loading
Render the loading state instead of the chart.
booleanfalse
border
Panel border colour. false removes it.
Colorssurfacetransparentboolean
neutral-alpha-weak
…and every ChartProps propinherited
…and every FlexProps propinherited
Edit this page on GitHub
TrademarkTrademark
Built with curiosity by Lorant One and the Design Engineers Club