Class SfChart
Represents the Chart control which is used to visualize the data graphically.
Inherited Members
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.WPF.dll
Syntax
public class SfChart : ChartBase, ICloneable, INotifyPropertyChanged, IDisposable
Remarks
The Chart is often used to make it easier to understand large amount of data and the relationship between different parts of the data. Chart can usually be read more quickly than the raw data that they come from.
Certain ChartSeriesBase are more useful for presenting a given data set than others. For example, data that presents percentages in different groups (such as "satisfied, not satisfied, unsure") are often displayed in a PieSeries chart, but are more easily understood when presented in a horizontal BarSeries chart. On the other hand, data that represents numbers that change over a period of time (such as "annual revenue from 2011 to 2012") might be best shown as a LineSeries chart.
Constructors
SfChart()
Called when instance created for SfChart.
Declaration
public SfChart()
Fields
AnnotationsProperty
The DependencyProperty for Annotations property.
Declaration
public static readonly DependencyProperty AnnotationsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
AreaBackgroundProperty
The DependencyProperty for AreaBackground property.
Declaration
public static readonly DependencyProperty AreaBackgroundProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
AreaBorderBrushProperty
The DependencyProperty for AreaBorderBrush property.
Declaration
public static readonly DependencyProperty AreaBorderBrushProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
AreaBorderThicknessProperty
The DependencyProperty for AreaBorderThickness property.
Declaration
public static readonly DependencyProperty AreaBorderThicknessProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
PrimaryAxisProperty
The DependencyProperty for PrimaryAxis property.
Declaration
public static readonly DependencyProperty PrimaryAxisProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SecondaryAxisProperty
The DependencyProperty for SecondaryAxis property.
Declaration
public static readonly DependencyProperty SecondaryAxisProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
SeriesProperty
The DependencyProperty for Series property.
Declaration
public static readonly DependencyProperty SeriesProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
TechnicalIndicatorsProperty
The DependencyProperty for TechnicalIndicators property.
Declaration
public static readonly DependencyProperty TechnicalIndicatorsProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
WatermarkProperty
The DependencyProperty for Watermark property.
Declaration
public static readonly DependencyProperty WatermarkProperty
Field Value
| Type |
|---|
| System.Windows.DependencyProperty |
Properties
Annotations
Gets or sets a collection of annotations to the chart.
Declaration
public AnnotationCollection Annotations { get; set; }
Property Value
| Type |
|---|
| AnnotationCollection |
AreaBackground
Gets or sets the background color of the plotting area.
Declaration
public Brush AreaBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Brush | The System.Windows.Media.Brush value. |
AreaBorderBrush
Gets or sets the color to paint the outline of chart area.
Declaration
public Brush AreaBorderBrush { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Windows.Media.Brush | The System.Windows.Media.Brush value. |
AreaBorderThickness
Gets or sets the outline thickness of chart area.
Declaration
public Thickness AreaBorderThickness { get; set; }
Property Value
| Type |
|---|
| System.Windows.Thickness |
Behaviors
Gets or sets the collection of chart behaviors.
Declaration
public ChartBehaviorsCollection Behaviors { get; set; }
Property Value
| Type |
|---|
| ChartBehaviorsCollection |
PrimaryAxis
Gets or sets primary axis for SfChart.
Declaration
public ChartAxisBase2D PrimaryAxis { get; set; }
Property Value
| Type |
|---|
| ChartAxisBase2D |
SecondaryAxis
Gets or sets the secondary axis for SfChart.
Declaration
public RangeAxisBase SecondaryAxis { get; set; }
Property Value
| Type |
|---|
| RangeAxisBase |
Series
Gets or sets a collection of series to be added to the chart. To render a series, create an instance of required series class, and add it to the collection.
Declaration
public ChartSeriesCollection Series { get; set; }
Property Value
| Type |
|---|
| ChartSeriesCollection |
TechnicalIndicators
Gets or sets a collection of technical indicators to the chart.
Declaration
public ObservableCollection<ChartSeries> TechnicalIndicators { get; set; }
Property Value
| Type |
|---|
| System.Collections.ObjectModel.ObservableCollection<ChartSeries> |
Watermark
Gets or sets the chart watermark.
Declaration
public Watermark Watermark { get; set; }
Property Value
| Type |
|---|
| Watermark |
Methods
AddZoomToolBar(ZoomingToolBar, ChartZoomPanBehavior)
Used to add the zooming toolbar in canvas.
Declaration
protected void AddZoomToolBar(ZoomingToolBar chartZoomingToolBar, ChartZoomPanBehavior zoomBehavior)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoomingToolBar | chartZoomingToolBar | ZoomingToolBar value. |
| ChartZoomPanBehavior | zoomBehavior | ChartZoomPanBehavior instance. |
Dispose()
Performs application-defined tasks accociated with freeing, releasing, or resetting unmanaged resource in SfChart.
Declaration
public void Dispose()
Dispose(Boolean)
Disposing chart objects.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Boolean | disposing | Used to indicate perform dispose or not. |
MeasureOverride(Size)
Provides the behavior for the Measure pass of Silverlight layout. Classes can override this method to define their own Measure pass behavior.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Size | availableSize | The size value. |
Returns
| Type | Description |
|---|---|
| System.Windows.Size | The size that this object determines it needs during layout, based on its calculations of the allocated sizes for child objects; or based on other considerations, such as a fixed container size. |
OnApplyTemplate()
When overridden in a derived class, is invoked whenever application code or internal processes (such as a rebuilding layout pass) call System.Windows.Controls.Control.ApplyTemplate. In simplest terms, this means the method is called just before a UI element displays in an application. For more information, see Remarks.
Declaration
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Returns class-specific System.Windows.Automation.Peers.AutomationPeer implementations for the WPF infrastructure.
Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
| Type | Description |
|---|---|
| System.Windows.Automation.Peers.AutomationPeer | The type-specific System.Windows.Automation.Peers.AutomationPeer implementation. |
OnDragEnter(DragEventArgs)
Called when drag enter into the chart.
Declaration
protected override void OnDragEnter(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | DragEventArgs. |
OnDragLeave(DragEventArgs)
Called when drag leave from the chart.
Declaration
protected override void OnDragLeave(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | DragEventArgs. |
OnDragOver(DragEventArgs)
Called when drag over the chart.
Declaration
protected override void OnDragOver(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | DragEventArgs. |
OnDrop(DragEventArgs)
Called when drop the pointer in the chart.
Declaration
protected override void OnDrop(DragEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.DragEventArgs | e | DragEventArgs. |
OnGotFocus(RoutedEventArgs)
Called when got focus in the SfChart.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | RoutedEventArgs. |
OnKeyDown(KeyEventArgs)
Called when the System.Windows.UIElement.KeyDown event occurs.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e | The data for the event. |
OnKeyUp(KeyEventArgs)
Called when the System.Windows.UIElement.KeyUp event occurs.
Declaration
protected override void OnKeyUp(KeyEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.KeyEventArgs | e | The data for the event. |
OnLostFocus(RoutedEventArgs)
called when lost focus from the SfChart.
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.RoutedEventArgs | e | RoutedEventArgs. |
OnManipulationCompleted(ManipulationCompletedEventArgs)
Called when the System.Windows.UIElement.ManipulationCompleted event occurs.
Declaration
protected override void OnManipulationCompleted(ManipulationCompletedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.ManipulationCompletedEventArgs | e | Event data for the event. |
OnManipulationDelta(ManipulationDeltaEventArgs)
Called when the System.Windows.UIElement.ManipulationDelta event occurs.
Declaration
protected override void OnManipulationDelta(ManipulationDeltaEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.ManipulationDeltaEventArgs | e | Event data for the event. |
OnManipulationStarted(ManipulationStartedEventArgs)
Called when the System.Windows.UIElement.ManipulationStarted event occurs.
Declaration
protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.ManipulationStartedEventArgs | e | Event data for the event. |
OnMouseEnter(MouseEventArgs)
Called when the System.Windows.UIElement.MouseEnter event occurs.
Declaration
protected override void OnMouseEnter(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The data for the event. |
OnMouseLeave(MouseEventArgs)
Called when the System.Windows.UIElement.MouseLeave event occurs.
Declaration
protected override void OnMouseLeave(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The data for the event. |
OnMouseLeftButtonDown(MouseButtonEventArgs)
Called when the System.Windows.UIElement.MouseLeftButtonDown event occurs.
Declaration
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The data for the event. |
OnMouseLeftButtonUp(MouseButtonEventArgs)
Called when the System.Windows.UIElement.MouseLeftButtonUp event occurs.
Declaration
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseButtonEventArgs | e | The data for the event. |
OnMouseMove(MouseEventArgs)
Called when the System.Windows.UIElement.MouseMove event occurs.
Declaration
protected override void OnMouseMove(MouseEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseEventArgs | e | The data for the event. |
OnMouseWheel(MouseWheelEventArgs)
Called when the System.Windows.UIElement.MouseWheel event occurs to provide handling for the event in a derived class without attaching a delegate.
Declaration
protected override void OnMouseWheel(MouseWheelEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.MouseWheelEventArgs | e | A System.Windows.Input.MouseWheelEventArgs that contains the event data. |
OnPanChanged(PanChangedEventArgs)
Occurs when panning position changed in chart.
Declaration
protected virtual void OnPanChanged(PanChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| PanChangedEventArgs | args | PanChangedEventArgs |
OnPanChanging(PanChangingEventArgs)
Occurs when panning takes place in chart.
Declaration
protected virtual void OnPanChanging(PanChangingEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| PanChangingEventArgs | args | PanChangingEventArgs |
OnResetZoom(ResetZoomEventArgs)
Occurs when zoom is reset.
Declaration
protected virtual void OnResetZoom(ResetZoomEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ResetZoomEventArgs | args | ResetZoomEventArgs. |
OnSelectionZoomingDelta(SelectionZoomingDeltaEventArgs)
Occurs while selection zooming in chart.
Declaration
protected virtual void OnSelectionZoomingDelta(SelectionZoomingDeltaEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectionZoomingDeltaEventArgs | args | SelectionZoomingDeltaEventArgs |
OnSelectionZoomingEnd(SelectionZoomingEndEventArgs)
Occurs at the end of selection zooming.
Declaration
protected virtual void OnSelectionZoomingEnd(SelectionZoomingEndEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectionZoomingEndEventArgs | args | SelectionZoomingEndEventArgs |
OnSelectionZoomingStart(SelectionZoomingStartEventArgs)
Occurs at the start of selection zooming.
Declaration
protected virtual void OnSelectionZoomingStart(SelectionZoomingStartEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| SelectionZoomingStartEventArgs | args | SelectionZoomingStartEventArgs |
OnSeriesBoundsChanged(ChartSeriesBoundsEventArgs)
Raises the SeriesBoundsChanged event.
Declaration
protected override void OnSeriesBoundsChanged(ChartSeriesBoundsEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartSeriesBoundsEventArgs | args | The ChartSeriesBoundsEventArgs instance containing the event data. |
Overrides
OnTouchDown(TouchEventArgs)
Called when touch down on the chart.
Declaration
protected override void OnTouchDown(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e | TouchEventArgs. |
OnTouchMove(TouchEventArgs)
Called when touch move on the chart.
Declaration
protected override void OnTouchMove(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e | TouchEventArgs. |
OnTouchUp(TouchEventArgs)
Called when touch up on the chart.
Declaration
protected override void OnTouchUp(TouchEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Windows.Input.TouchEventArgs | e | TouchEventArgs |
OnZoomChanged(ZoomChangedEventArgs)
Occurs when zooming position changed in chart.
Declaration
protected virtual void OnZoomChanged(ZoomChangedEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoomChangedEventArgs | args | ZoomChangedEventArgs |
OnZoomChanging(ZoomChangingEventArgs)
Occurs when zooming takes place in chart.
Declaration
protected virtual void OnZoomChanging(ZoomChangingEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoomChangingEventArgs | args | ZoomChangingEventArgs |
RemoveZoomToolBar(ZoomingToolBar)
Declaration
protected void RemoveZoomToolBar(ZoomingToolBar chartZoomingToolBar)
Parameters
| Type | Name | Description |
|---|---|---|
| ZoomingToolBar | chartZoomingToolBar |
SeriesSelectedIndexChanged(Int32, Int32)
Method used to highlight selected index series.
Declaration
public override void SeriesSelectedIndexChanged(int newIndex, int oldIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | newIndex | Used to indicate current selected index. |
| System.Int32 | oldIndex | Used to indicate previous selected index. |
Overrides
ValueToPoint(ChartAxis, Double)
Converts Value to point.
Declaration
public override double ValueToPoint(ChartAxis axis, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartAxis | axis | The Chart axis . |
| System.Double | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Double | The double value to point. |
Overrides
ValueToPointRelativeToAnnotation(ChartAxis, Double)
Converts Value to point.
Declaration
public double ValueToPointRelativeToAnnotation(ChartAxis axis, double value)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartAxis | axis | The Chart axis . |
| System.Double | value | The value. |
Returns
| Type | Description |
|---|---|
| System.Double | The double value to point. |
Events
PanChanged
Occurs when panning position of chart is changed.
Declaration
public event EventHandler<PanChangedEventArgs> PanChanged
Event Type
| Type |
|---|
| System.EventHandler<PanChangedEventArgs> |
PanChanging
Occurs when panning takes place in chart.
Declaration
public event EventHandler<PanChangingEventArgs> PanChanging
Event Type
| Type |
|---|
| System.EventHandler<PanChangingEventArgs> |
ResetZooming
Occurs when the zoom is reset.
Declaration
public event EventHandler<ResetZoomEventArgs> ResetZooming
Event Type
| Type |
|---|
| System.EventHandler<ResetZoomEventArgs> |
SelectionZoomingDelta
Occurs during selection zooming.
Declaration
public event EventHandler<SelectionZoomingDeltaEventArgs> SelectionZoomingDelta
Event Type
| Type |
|---|
| System.EventHandler<SelectionZoomingDeltaEventArgs> |
SelectionZoomingEnd
Occurs at the end of selection zooming.
Declaration
public event EventHandler<SelectionZoomingEndEventArgs> SelectionZoomingEnd
Event Type
| Type |
|---|
| System.EventHandler<SelectionZoomingEndEventArgs> |
SelectionZoomingStart
Occurs at the start of selection zooming.
Declaration
public event EventHandler<SelectionZoomingStartEventArgs> SelectionZoomingStart
Event Type
| Type |
|---|
| System.EventHandler<SelectionZoomingStartEventArgs> |
ZoomChanged
Occurs when chart zooming value is changed.
Declaration
public event EventHandler<ZoomChangedEventArgs> ZoomChanged
Event Type
| Type |
|---|
| System.EventHandler<ZoomChangedEventArgs> |
ZoomChanging
Occurs when zooming takes place in chart.
Declaration
public event EventHandler<ZoomChangingEventArgs> ZoomChanging
Event Type
| Type |
|---|
| System.EventHandler<ZoomChangingEventArgs> |