Class DataPointSelectionBehavior
Enables the selection of individual or multiple data points in a series.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.Chart.WinUI.dll
Syntax
public class DataPointSelectionBehavior : ChartSelectionBehavior
Remarks
To enable the data point selection in the chart, create an instance of DataPointSelectionBehavior and set it to the SelectionBehavior
property of the chart or series. To highlight the selected segment data label, set the value for SelectionBrush property in DataPointSelectionBehavior.
It provides the following options to customize the appearance of selected data point:
Type - To select single or multiple data points in a chart, refer to the Type property.
SelectionBrush - To highlight the selected data point, refer to the SelectionBrush property.
SelectedIndex - To select a data point programmatically, refer to the SelectedIndex property.
SelectedIndexes - To select multiple points programmatically, refer to the SelectedIndexes property.
Events - The SelectionChanging event occurs before the data point is being selected. The SelectionChanged event occurs after a data point has been selected.
Examples
<chart:SfCircularChart>
<chart:SfCircularChart.DataContext>
<local:ViewModel/>
</chart:SfCircularChart.DataContext>
<chart:PieSeries ItemsSource="{Binding Data}"
XBindingPath="XValue"
YBindingPath="YValue">
<chart:PieSeries.SelectionBehavior>
<chart:DataPointSelectionBehavior SelectionBrush = "Red" />
</chart:PieSeries.SelectionBehavior>
</chart:PieSeries>
</chart:SfCircularChart>
Constructors
DataPointSelectionBehavior()
Declaration
public DataPointSelectionBehavior()