<ig:XamDataPieChart ItemsSource="{Binding Data}"
HighlightingBehavior="NearestItems"
HighlightingMode="BrightenSpecific" />
This topic provides information for enabling and using the different highlighting features in the XamDataPieChart control.
The topic contains the following sections:
This article assumes you have already read the Data Binding topic, and uses the code within it as a starting point.
The XamDataPieChart supports mouse over highlighting, as well as a highlighting overlay that can be configured by providing a separate data source. The following sections describe these features in more detail:
The HighlightingBehavior
property determines how a slice will be highlighted. This is represented by a SeriesHighlightingBehavior
enumeration. The following are the options of that enumeration and what they do:
DirectlyOver
: The slices are only highlighted when the mouse is directly over them.
NearestItems
: The nearest slice to the mouse position will be highlighted.
NearestItemsAndSeries
: The nearest slice and series to the mouse position will be highlighted.
NearestItemsRetainMainShapes
: The nearest items to the mouse position will be highlighted and the main shapes of the series will not be de-emphasized.
The HighlightingMode
property determines how the data pie chart slices respond to being highlighted. This property is defined by the SeriesHighlightingMode
enumeration. The following are the options of that enumeration and what they do:
Brighten
: The series will have its color brightened when the mouse position is over or near it.
BrightenSpecific
: The specific slice will have its color brightened when the mouse position is over or near it.
FadeOthers
: The series will retain its color when the mouse position is over or near it, while the others will appear faded.
FadeOthersSpecific
: The specific slice will retain its color when the mouse position is over or near it, while the others will appear faded.
None
: The series and slices will not be highlighted.
The highlight filter of the XamDataPieChart is applied by specifying a HighlightedDataSource
for the control and by setting the HighlightedValuesDisplayMode
property to Overlay
. The HighlightedDataSource
expects a subset of the data assigned to the DataSource
property of the XamDataPieChart.
When these conditions are met, the values of the subset will be highlighted, while the remainder of the full set of data will be faded - effectively creating a highlight for the subset and allowing easier visualization of a subset of your data within the same control.
In XAML:
<ig:XamDataPieChart ItemsSource="{Binding Data}"
HighlightingBehavior="NearestItems"
HighlightingMode="BrightenSpecific" />
In C#:
XamDataPieChart dataPieChart = new XamDataPieChart()
{
ItemsSource = data,
HighlightingMode = SeriesHighlightingMode.BrightenSpecific,
HighlightingBehavior = SeriesHighlightingBehavior.NearestItems
};