Version

Others Category

This topic demonstrates how to configure the Others category for the XamDataPieChart control. At the end of the topic, the complete code sample is provided.

The topic is organized as follows:

Introduction

Sometimes, the underlying data for the Data Pie Chart control will contain many items with small values. In this case, the Others category will permit automatic aggregation of several data values into a single slice.

Requirements

This topic assumes you have already read the Data Binding topic, and uses the code therein as a starting point.

Configuring the Others Category

The Others category in the XamDataPieChart has three main, configurable properties - OthersCategoryType, OthersCategoryThreshold, and OthersCategoryText that allow you to configure how the Others slice in the chart is shown. These are each described below:

The OthersCategoryType property works in tandem with the OthersCategoryThreshold property of the XamDataPieChart. For the OthersCategoryType, you can define whether you want the OthersCategoryThreshold to be evaluated as a number or a percentage. For example, if you decide on number and set the OthersCategoryThreshold to 5, any slices that have a value less than 5 will become part of the Others category. Using the same value of 5 with a percent type, any values that are less than 5 percent of the total values of the XamDataPieChart will become part of the Others category.

By default, the Others slice will be represented by a label of "Others." You can change this by modifying the OthersCategoryText property of the chart.

If you want to ensure that the Others category does not show up in the XamDataPieChart, you can set the OthersCategoryThreshold to 0.

Code Example

The following code example demonstrates the usage of the Others category in the XamDataPieChart.

In XAML:

TODO

In C#:

TODO

Related Content