Show parts of a whole as a pie or a donut, with a legend that hides slices.
Why it helps
- Pie or donut
- Legend toggling
- Click on slices
Where it fits
- Traffic sources
- Budget split
- Shares
Example
<Stack Spacing="6">
<PieChart Label="Devices" Slices="_slices" ShowDataLabels="true" ShowExport="true" />
<PieChart Label="Devices (donut)" Slices="_slices" Donut="true" ShowDataLabels="true" CenterText="2026" />
</Stack>
@code {
private readonly ChartSlice[] _slices = [new("Desktop", 64), new("Phone", 19), new("Tablet", 5), new("TV", 3), new("Other", 9)];
} A short fragment. Add @using RayCraft.Blazor.Components to your page and use an interactive render mode.
Part of RayCraft Complete.