Articles in this section
Category / Section

How to Group Small Data Segments in .NET MAUI Circular Charts?

In .NET MAUI Circular Chart, you can group small data segments in Pie and Doughnut series into a single category labeled “Others”. This functionality helps maintain a clean and concise visual representation when dealing with numerous small data segments.
You can achieve this by using the GroupTo and GroupMode properties of the PieSeries.

GroupMode: Specifies the grouping type for small data segments. It determines how segments are grouped based on:

  1. Value: Segments are grouped based on their actual data point value.
  2. Angle: Segments are grouped based on their slice angle.
  3. Percentage: Segments are grouped based on their contribution percentage.

GroupTo: Specifies the threshold value for grouping small segments. It determines which data points should be grouped. Segments with values below the specified threshold will be grouped into a single slice, labeled as Others in the chart legend.

For detailed steps on initializing the SfCircularChart in .NET MAUI, please refer to the documentatin.

1. Grouping Based on Actual Data Value

The following example demonstrates how to group small data segments in the PieSeries based on their actual data value :

[XAML]

    <chart:SfCircularChart>
        . . .
        <chart:PieSeries ItemsSource="{Binding Data}"  
                         XBindingPath="Product"
                         YBindingPath="SalesRate"
                         ShowDataLabels="True"
                         EnableTooltip="True" 
                         TooltipTemplate="{StaticResource tooltipTemplate}"
                         GroupMode="Value"
                         GroupTo="15"/>
   </chart:SfCircularChart>

[C#]

SfCircularChart chart = new SfCircularChart();
. . .
PieSeries series = new PieSeries();
series.ItemsSource = viewModel.Data;
series.XBindingPath = "Product";
series.YBindingPath = "SalesRate";
series.ShowDataLabels = true;
series.EnableTooltip = true;
series.TooltipTemplate = chart.Resources["tooltipTemplate"] as DataTemplate;
series.GroupMode  = PieGroupMode.Value;
series.GroupTo = 15;

chart.Series.Add(series);

Output

Circular Charts with small data segments grouped under 'Others'.png

The products with a SalesRate less than 15 will be grouped into a single slice labeled “Others” in the chart legend.
In this case, the Smartwatch, Mouse, Keyboard, and USB Drive all have values less than 15. Therefore, these segments are grouped under the Others category in the chart.

2. Grouping Based on Slice Angle

The following example demonstrates how to group small data segments in the PieSeries based on their slice angle :

[XAML]

    <chart:SfCircularChart>
        . . .
        <chart:PieSeries ItemsSource="{Binding Data}"  
                         XBindingPath="Product"
                         YBindingPath="SalesRate"
                         ShowDataLabels="True"
                         GroupMode="Angle"
                         GroupTo="90"/>
   </chart:SfCircularChart>

[C#]

SfCircularChart chart = new SfCircularChart();
. . .
PieSeries series = new PieSeries();
series.ItemsSource = viewModel.Data;
series.XBindingPath = "Product";
series.YBindingPath = "SalesRate";
series.ShowDataLabels = true;
series.GroupMode  = PieGroupMode.Angle;
series.GroupTo = 90;

chart.Series.Add(series);

Output

Circular_Charts_with_small_data_segments_grouped_under_Others.png

Segments slice angle less than 90° are grouped into the “Others” category.
In this case, Mobile, Headphones, Smartwatch, Mouse, Keyboard, and USB Drive all have a slice angle less than 90°. Therefore, these segments are grouped under the Others category in the chart.

3. Grouping Based on Percentage

The following example demonstrates how to group small data segments in the PieSeries based on their contribution percentage:

[XAML]

    <chart:SfCircularChart>
        . . .
        <chart:PieSeries ItemsSource="{Binding Data}"  
                         XBindingPath="Product"
                         YBindingPath="SalesRate"
                         ShowDataLabels="True"
                         EnableTooltip="True" 
                         TooltipTemplate="{StaticResource tooltipTemplate}"
                         GroupMode="Percentage"
                         GroupTo="10"/>
   </chart:SfCircularChart>

[C#]

SfCircularChart chart = new SfCircularChart();
. . .
PieSeries series = new PieSeries();
series.ItemsSource = viewModel.Data;
series.XBindingPath = "Product";
series.YBindingPath = "SalesRate";
series.ShowDataLabels = true;
series.EnableTooltip = true;
series.TooltipTemplate = chart.Resources["tooltipTemplate"] as DataTemplate;
series.GroupMode  = PieGroupMode.Percentage;
series.GroupTo = 10;

chart.Series.Add(series);

Output

Circular Charts with small data segments grouped under 'Others'.png

Segments contributing less than 10% to the sales rate are grouped under the Others category. In this example, the Smartwatch, Mouse, Keyboard, and USB Drive are grouped together.

Conclusion

I hope you enjoyed learning how to group small data segments in .NET MAUI Circular Charts.

Refer to our .NET MAUI Circular Chart feature tour page to learn about its other groundbreaking feature representations. You can also explore our .NET MAUI Chart documentation to understand how to present and manipulate data.

For current customers, check out our .NET MAUI from the License and Downloads page. If you are new to Syncfusion®, try our 30-day free trial to check out our .NET MAUI Chart and other .NET MAUI components.

Please let us know in the comments section if you have any queries or require clarification. You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied