Class ChartSelectionBehavior
ChartSelectionBehavior enables the selection of segments in a Chart.
Implements
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.WPF.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 |
---|
System.Windows.DependencyProperty |
EnableSeriesSelectionProperty
The DependencyProperty for EnableSeriesSelection property.
Declaration
public static readonly DependencyProperty EnableSeriesSelectionProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectionCursorProperty
The DependencyProperty for SelectionCursor property.
Declaration
public static readonly DependencyProperty SelectionCursorProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectionModeProperty
The DependencyProperty for SelectionMode property.
Declaration
public static readonly DependencyProperty SelectionModeProperty
Field Value
Type |
---|
System.Windows.DependencyProperty |
SelectionStyleProperty
The DependencyProperty for SelectionStyle property.
Declaration
public static readonly DependencyProperty SelectionStyleProperty
Field Value
Type |
---|
System.Windows.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 mouse cursor for the series, which indicates that the series selection cursor type.
Declaration
public Cursor SelectionCursor { get; set; }
Property Value
Type |
---|
System.Windows.Input.Cursor |
Remarks
Default value is null
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 |
---|---|---|
System.Windows.DependencyObject | obj |
Returns
Type |
---|
System.Windows.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 |
---|---|
System.Windows.Media.Brush | Returns brush for selected segment. |
OnMouseLeave(MouseEventArgs)
Called when mouse leaved in the chart.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | MouseEventArgs |
Overrides
OnMouseLeftButtonDown(MouseButtonEventArgs)
Called when mouse left button is clicked.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | MouseButtonEventArgs |
Overrides
OnMouseLeftButtonUp(MouseButtonEventArgs)
Called when mouse left button was released.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseButtonEventArgs | e | MouseButtonEventArgs |
Overrides
OnMouseMove(MouseEventArgs)
Called when mouse moved in the chart.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Windows.Input.MouseEventArgs | e | MouseEventArgs |
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 |