Grouping Data Points in .NET MAUI SfCircularChart

10 Jan 20251 minute to read

The small segments in the circular chart can be grouped into an Others category using the GroupTo and GroupMode properties of the PieSeries. The GroupMode property is used to specify the grouping type based on slice angle, actual data point value, or percentage. The GroupTo property is used to set the limit to group data points into a single slice. The grouped segment is labeled as Others in the chart legend.

NOTE

GroupTo only support for pie and doughnut chart.

<chart:SfCircularChart>

    <chart:PieSeries ItemsSource="{Binding Data}" 
                     GroupMode="Value"
                     GroupTo="15"
                     XBindingPath="Product" 
                     YBindingPath="SalesRate"/>
  
</chart:SfCircularChart>
SfCircularChart chart = new SfCircularChart();
. . .
PieSeries series = new PieSeries()
{
    ItemsSource = new ViewModel().Data,
    XBindingPath = "Product", 
    YBindingPath = "SalesRate",
    GroupMode = Value, // Set the mode for grouping smaller slices into a single slice.
    GroupTo = 15 // Define a threshold value for the group mode. 
};

chart.Series.Add(series);
this.Content = chart;

Grouped data points pie chart in MAUI