Demo
Semi pie, rings and grouping
Documented in PieChart.
Semi pie, rings and grouping
A semi pie with a pad angle, concentric rings for two years, small slices grouped into "Others", average-filled empty points and system patterns.
Doughnut chart, 6 slices. Android: 44, 44%; iOS: 31, 31%; Windows: 12, 12%; macOS: 7, 7%; Linux: 3, 3%; Other: 3, 3%.
| Label | Value | Percent |
|---|---|---|
| Android | 44 | 44% |
| iOS | 31 | 31% |
| Windows | 12 | 12% |
| macOS | 7 | 7% |
| Linux | 3 | 3% |
| Other | 3 | 3% |
Doughnut chart, 6 slices, 2 series. Android: 47, 45.6%; iOS: 29, 28.2%; Windows: 15, 14.6%; macOS: 5, 4.9%; Linux: 6, 5.8%; Other: 1, 1%.
| Label | Series | Value | Percent |
|---|---|---|---|
| Android | 2025 | 44 | 44% |
| iOS | 2025 | 31 | 31% |
| Windows | 2025 | 12 | 12% |
| macOS | 2025 | 7 | 7% |
| Linux | 2025 | 3 | 3% |
| Other | 2025 | 3 | 3% |
| Android | 2026 | 47 | 45.6% |
| iOS | 2026 | 29 | 28.2% |
| Windows | 2026 | 15 | 14.6% |
| macOS | 2026 | 5 | 4.9% |
| Linux | 2026 | 6 | 5.8% |
| Other | 2026 | 1 | 1% |
Pie chart, 4 slices. Android: 44, 44%; iOS: 31, 31%; Windows: 12, 12%; Others: 13, 13%.
| Label | Value | Percent |
|---|---|---|
| Android | 44 | 44% |
| iOS | 31 | 31% |
| Windows | 12 | 12% |
| Others | 13 | 13% |
Demo.tsx
'use client';
import { PieChart } from '@salmonui/charts/pie-chart';
const share = [
{ os: 'Android', v: 44 },
{ os: 'iOS', v: 31 },
{ os: 'Windows', v: 12 },
{ os: 'macOS', v: 7 },
{ os: 'Linux', v: 3 },
{ os: 'Other', v: 3 },
];
export default function PieChartVariantsDemo() {
return (
<div className="demo-stack">
<PieChart title="Semi pie" data={share} valueField="v" labelField="os" height={240} startAngle={-90} endAngle={90} padAngle={2} center={{ y: '80%' }} radius="95%" innerRadius="45%" labels={false} />
<PieChart
title="2025 and 2026"
height={240}
innerRadius={30}
labels={false}
patterns
series={[
{ name: '2025', data: share, valueField: 'v', labelField: 'os' },
{ name: '2026', data: share.map((d, i) => ({ ...d, v: d.v + (i % 2 ? -2 : 3) })), valueField: 'v', labelField: 'os' },
]}
/>
<PieChart title="Grouped" data={share} valueField="v" labelField="os" height={240} groupSmall={{ threshold: 8, label: 'Others' }} emptyPoints="average" />
</div>
);
}
Rings are drawn inner to outer from series; groupSmall merges slices
under 8 % into one "Others" slice; patterns adds a fill pattern per slot
for readers who cannot tell the colors apart.