Skip to main content

Donut chart

info

Charts are available with Avalonia Pro.

A donut chart is a variation of the pie chart that uses a non-zero InnerRadiusFactor. This design lets you reserve the center for a summary value or label.

Donut chart with a blank center hole showing proportional segments of revenue distribution by source.

When to use

  • Proportional comparison: Similar to a pie chart, but with more room for labels or totals in the center.
  • Summary views: Where the central space can be used to display the total sum or a key metric.
  • Minimalist dashboards: Highly effective for simple part-to-whole visualizations with few categories.

Code example

XAML

<charts:PieChart Name="DonutChartSample" IsTooltipEnabled="True" Title="Revenue Distribution" Height="300" InnerRadiusFactor="0.6">
<charts:PieChart.Series>
<charts:PieSeries ItemsSource="{Binding DonutChartData}" LabelPath="Value" />
</charts:PieChart.Series>
</charts:PieChart>

Data model (C#)

public ObservableCollection<double> DonutChartData { get; } = new()
{
40, 30, 20, 10
};

There is no specific DonutChart control. Use PieChart and set InnerRadiusFactor to a value greater than 0.0.

Common properties

PieChart

PropertyDescriptionDefault
InnerRadiusFactorThe size of the center hole, from 0.0 to 1.0.0.0
TitleChart title displayed above the donut.null
PaletteCustom collection of brushes for the slices.Theme-dependent

PieSeries

PropertyDescriptionDefault
ItemsSourceThe collection of data slices.null
LabelPathPath to the text to display on or near slices.null
ValuePathPath to the numerical value for slice sizing.null
RadiusFactorOuter radius factor for the series, from 0.0 to 1.0.0.9
InnerRadiusFactorOptional inner radius factor for the series. When null, the chart-level value is used.null
StartAngleStart angle in degrees for the first slice.-90.0
ShowLabelsWhether to display labels on the slices.true
LabelPositionPosition of slice labels, Inside or Outside.Inside
SliceLabelFormatFormat used for slice labels.Percentage
LabelFontSizeFont size used for slice labels.11.0
LabelForegroundBrush used for slice labels.null