Class ChartSelectionBehavior
ChartSelectionBehavior enables the selection of segments in a Chart.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.UWP.dll
Syntax
public class ChartSelectionBehavior : ChartBehavior, ICloneable
Remarks
The selected segment can be displayed with a different color specified using SegmentSelectionBrush property available in corresponding series. ChartSelectionBehavior is applicable only to certain series such as ColumnSeries,BarSeries, RangeColumnSeries,StackingBarSeries,StackingColumnSeries,ScatterSeries, BubbleSeries,PieSeries.
Examples
This example, we are using ChartSelectionBehavior.
<syncfusion:SfChart>
<syncfusion:SfChart.Behaviors>
<syncfusion:ChartSelectionBehavior/>
</syncfusion:SfChart.Behaviors>
</syncfusion:SfChart>
ChartSelectionBehavior selectionBehavior = new ChartSelectionBehavior();
chartArea.Behaviors.Add(selectionBehavior);
Constructors
ChartSelectionBehavior()
Declaration
public ChartSelectionBehavior()
Fields
EnableSegmentSelectionProperty
The DependencyProperty for EnableSegmentSelection property.
Declaration
public static readonly DependencyProperty EnableSegmentSelectionProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
EnableSeriesSelectionProperty
The DependencyProperty for EnableSeriesSelection property.
Declaration
public static readonly DependencyProperty EnableSeriesSelectionProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
SelectionCursorProperty
The DependencyProperty for SelectionCursor property.
Declaration
public static readonly DependencyProperty SelectionCursorProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
SelectionModeProperty
The DependencyProperty for SelectionMode property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
SelectionStyleProperty
The DependencyProperty for SelectionStyle property.
Declaration
public static readonly DependencyProperty SelectionStyleProperty
Field Value
Type |
---|
Windows.UI.Xaml.DependencyProperty |
Properties
EnableSegmentSelection
Gets or sets a value indicating whether the segment (or) datapoint selection is enabled or not.
Declaration
public bool EnableSegmentSelection { get; set; }
Property Value
Type |
---|
System.Boolean |
EnableSeriesSelection
Gets or sets a value indicating whether the series selection is enabled or not.
Declaration
public bool EnableSeriesSelection { get; set; }
Property Value
Type |
---|
System.Boolean |
SelectionCursor
Gets or sets the pointer cursor for the series, which indicates that the series selection cursor type.
Declaration
public CoreCursorType SelectionCursor { get; set; }
Property Value
Type | Description |
---|---|
Windows.UI.Core.CoreCursorType | Windows.UI.Core.CoreCursorType |
Remarks
Default value is Arrow.
SelectionMode
Gets or sets the selection mode value, which indicates that this series is how to selectable.
Declaration
public SelectionMode SelectionMode { get; set; }
Property Value
Type |
---|
SelectionMode |
SelectionStyle
Gets or sets the SelectionStyle value that indicated the selection type in SfChart.
Declaration
public SelectionStyle SelectionStyle { get; set; }
Property Value
Type | Description |
---|---|
SelectionStyle |
Methods
CloneBehavior(DependencyObject)
Declaration
protected override DependencyObject CloneBehavior(DependencyObject obj)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.DependencyObject | obj |
Returns
Type |
---|
Windows.UI.Xaml.DependencyObject |
Overrides
GetSeriesSelectionBrush(ChartSeriesBase)
Method used to get selection brush for series selection.
Declaration
public virtual Brush GetSeriesSelectionBrush(ChartSeriesBase series)
Parameters
Type | Name | Description |
---|---|---|
ChartSeriesBase | series | ChartSeriesBase |
Returns
Type | Description |
---|---|
Windows.UI.Xaml.Media.Brush | Returns brush for selected segment. |
OnPointerExited(PointerRoutedEventArgs)
Called when pointer exited in the chart.
Declaration
protected override void OnPointerExited(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Input.PointerRoutedEventArgs | e | PointerRoutedEventArgs |
Overrides
OnPointerMoved(PointerRoutedEventArgs)
Called when pointer moved in the chart.
Declaration
protected override void OnPointerMoved(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Input.PointerRoutedEventArgs | e | PointerRoutedEventArgs |
Overrides
OnPointerPressed(PointerRoutedEventArgs)
Called when pointer pressed in the chart.
Declaration
protected override void OnPointerPressed(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Input.PointerRoutedEventArgs | e | PointerRoutedEventArgs |
Overrides
OnPointerReleased(PointerRoutedEventArgs)
Called when pointer released in the chart.
Declaration
protected override void OnPointerReleased(PointerRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Windows.UI.Xaml.Input.PointerRoutedEventArgs | e | PointerRoutedEventArgs |
Overrides
OnSelectionChanged(ChartSelectionChangedEventArgs)
Invoked whenever the SelectionChanged event have raised.
Declaration
protected virtual void OnSelectionChanged(ChartSelectionChangedEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
ChartSelectionChangedEventArgs | eventArgs | type of ChartSelectionChangedEventArgs |
OnSelectionChanging(ChartSelectionChangingEventArgs)
Invoked whenever the SelectionChanging event have raised.
Declaration
protected virtual void OnSelectionChanging(ChartSelectionChangingEventArgs eventArgs)
Parameters
Type | Name | Description |
---|---|---|
ChartSelectionChangingEventArgs | eventArgs | type of ChartSelectionChangingEventArgs |