# Donut Chart
> Donut charts for part-to-whole data
Source: https://shellui.dev/docs/v0.4/components/advanced/charts/donut-chart
`DonutChart` renders a donut chart for part-to-whole data. Built on ApexCharts, with the same custom tooltips and themes as the other ShellUI charts.
## Installation
```bash
shellui add donut-chart
```
`shellui add` also installs `chart` and its styles, and adds the `Blazor-ApexCharts` NuGet package to your project.
## Usage
```razor
@code {
private List _traffic = new()
{
new("Search", 4200), new("Direct", 2100),
new("Social", 1300), new("Referral", 800)
};
record Traffic(string Source, int Visits);
}
```
## API Reference
| Property | Type | Default | Description |
|----------|------|---------|-------------|
| `TItem` | `Generic type` | — | The data item type |
| `Data` | `IEnumerable?` | `null` | Data collection to visualize |
| `Name` | `string` | `"Data"` | Series name shown in the tooltip |
| `XValue` | `Func?` | `null` | Category label for each item |
| `YValue` | `Func?` | `null` | Numeric value for each item |
| `Theme` | `ChartTheme` | `Default` | Color theme (Default, Colorful, Monochrome) |
| `Title` | `string?` | `null` | Chart title |
| `Subtitle` | `string?` | `null` | Chart subtitle |
| `Height` | `string?` | `"400px"` | Chart height |
| `Width` | `string?` | `"100%"` | Chart width |
| `ShowLegend` | `bool` | `true` | Show the legend |
| `ShowToolbar` | `bool` | `false` | Show the ApexCharts toolbar |
| `Class` | `string?` | `null` | Additional CSS classes |