Class ChartBase
ChartBase is a base class for chart. Which represents a chart control with basic presentation characteristics.
Namespace: Syncfusion.UI.Xaml.Charts
Assembly: Syncfusion.SfChart.UWP.dll
Syntax
public abstract class ChartBase : Control, ICloneable, INotifyPropertyChanged
Constructors
ChartBase()
Declaration
protected ChartBase()
Fields
AxisThicknessProperty
The DependencyProperty for AxisThickness property.
Declaration
public static readonly DependencyProperty AxisThicknessProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
ColorModelProperty
The DependencyProperty for ColorModel property.
Declaration
public static readonly DependencyProperty ColorModelProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
ColumnProperty
The DependencyProperty for
Declaration
public static readonly DependencyProperty ColumnProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
ColumnSpanProperty
The DependencyProperty for
Declaration
public static readonly DependencyProperty ColumnSpanProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
HeaderProperty
The DependencyProperty for Header property.
Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
HorizontalHeaderAlignmentProperty
The DependencyProperty for HorizontalHeaderAlignment property.
Declaration
public static readonly DependencyProperty HorizontalHeaderAlignmentProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
LegendProperty
The DependencyProperty for Legend property.
Declaration
public static readonly DependencyProperty LegendProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
PaletteProperty
The DependencyProperty for Palette property.
Declaration
public static readonly DependencyProperty PaletteProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
Printing
Declaration
protected Printing Printing
Field Value
| Type |
|---|
| Printing |
RowProperty
The DependencyProperty for
Declaration
public static readonly DependencyProperty RowProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
RowSpanProperty
The DependencyProperty for
Declaration
public static readonly DependencyProperty RowSpanProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SeriesSelectedIndexProperty
The DependencyProperty for SeriesSelectedIndex property.
Declaration
public static readonly DependencyProperty SeriesSelectedIndexProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
SideBySideSeriesPlacementProperty
The DependencyProperty for SideBySideSeriesPlacement property.
Declaration
public static readonly DependencyProperty SideBySideSeriesPlacementProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
VerticalHeaderAlignmentProperty
The DependencyProperty for VerticalHeaderAlignment property.
Declaration
public static readonly DependencyProperty VerticalHeaderAlignmentProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
VisibleSeriesProperty
The DependencyProperty for VisibleSeries property.
Declaration
public static readonly DependencyProperty VisibleSeriesProperty
Field Value
| Type |
|---|
| Windows.UI.Xaml.DependencyProperty |
Properties
Axes
Gets the collection of horizontal and vertical axis.
Declaration
public ChartAxisCollection Axes { get; }
Property Value
| Type |
|---|
| ChartAxisCollection |
AxisThickness
Gets or sets thickness to the axis.
Declaration
public Thickness AxisThickness { get; }
Property Value
| Type |
|---|
| Windows.UI.Xaml.Thickness |
ColorModel
Gets or sets the color schemes for all series in the chart.
Declaration
public ChartColorModel ColorModel { get; set; }
Property Value
| Type | Description |
|---|---|
| ChartColorModel |
ColumnDefinitions
Gets or sets the collection of ChartColumnDefinition objects defined in the chart.
Declaration
public ChartColumnDefinitions ColumnDefinitions { get; set; }
Property Value
| Type |
|---|
| ChartColumnDefinitions |
Header
Gets or sets title for the chart.
Declaration
public object Header { get; set; }
Property Value
| Type |
|---|
| System.Object |
HorizontalHeaderAlignment
Gets or sets the horizontal alignment for the header.
Declaration
public HorizontalAlignment HorizontalHeaderAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| Windows.UI.Xaml.HorizontalAlignment | Windows.UI.Xaml.HorizontalAlignment |
Legend
Gets or sets a legend that helps to identify the series in the chart.
Declaration
public object Legend { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Object | The legend. |
Palette
Gets or sets palette for chart. By default, it is Metro.
Declaration
public ChartColorPalette Palette { get; set; }
Property Value
| Type | Description |
|---|---|
| ChartColorPalette |
RowDefinitions
Gets or sets the collection of ChartRowDefinition objects defined in chart.
Declaration
public ChartRowDefinitions RowDefinitions { get; set; }
Property Value
| Type |
|---|
| ChartRowDefinitions |
SelectedSegments
Gets the selected segments in this series, when we enable the multiple selection.
Declaration
protected virtual List<ChartSegment> SelectedSegments { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<ChartSegment> | It returns list of ChartSegment. |
SeriesClipRect
Gets a bounds of chart area excluding axis and chart header.
Declaration
public Rect SeriesClipRect { get; }
Property Value
| Type |
|---|
| Windows.Foundation.Rect |
SeriesSelectedIndex
Gets or sets the index to select the series.
Declaration
public int SeriesSelectedIndex { get; set; }
Property Value
| Type |
|---|
| System.Int32 |
SideBySideSeriesPlacement
Gets or sets the value that indicates whether the series can be placed side by side.
Declaration
public bool SideBySideSeriesPlacement { get; set; }
Property Value
| Type |
|---|
| System.Boolean |
VerticalHeaderAlignment
Gets or sets the vertical alignment for the header.
Declaration
public VerticalAlignment VerticalHeaderAlignment { get; set; }
Property Value
| Type | Description |
|---|---|
| Windows.UI.Xaml.VerticalAlignment | Windows.UI.Xaml.VerticalAlignment |
VisibleSeries
Gets the collection of visible series in the chart.
Declaration
public ChartVisibleSeriesCollection VisibleSeries { get; }
Property Value
| Type |
|---|
| ChartVisibleSeriesCollection |
Remarks
This property is intended to be used for custom
Methods
Clone()
Clone the entire chart control.
Declaration
public DependencyObject Clone()
Returns
| Type |
|---|
| Windows.UI.Xaml.DependencyObject |
Deserialize(Stream)
Method used to deserialize the serialized file.
Declaration
public object Deserialize(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream | Used to specify stream. |
Returns
| Type | Description |
|---|---|
| System.Object | The deserialized object. |
Deserialize(StorageFile)
Method used to deserialize the serialized file.
Declaration
public object Deserialize(StorageFile storageFile)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.Storage.StorageFile | storageFile |
Returns
| Type | Description |
|---|---|
| System.Object | The deserialized object. |
GetColumn(UIElement)
Get the column value from the given ChartAxis.
Declaration
public static int GetColumn(UIElement obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | obj | The UIElement. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Column value of given object. |
GetColumnSpan(UIElement)
Gets the value of the Syncfusion.UI.Xaml.Charts.ColumnSpan attached property from a given UIElement.
Declaration
public static int GetColumnSpan(UIElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | element | The element from which to read the property value. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The value of the Syncfusion.UI.Xaml.Charts.ColumnSpan attached property. |
GetCumulativeStackInfo(ChartSeriesBase, Boolean)
Returns the stacked value of the series.
Declaration
public List<double> GetCumulativeStackInfo(ChartSeriesBase series, bool reqNegStack)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartSeriesBase | series | ChartSeries |
| System.Boolean | reqNegStack | RequiresNegativeStack |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<System.Double> | StackedYValues collection. |
GetRow(UIElement)
Return row value from the given ChartAxis.
Declaration
public static int GetRow(UIElement obj)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | obj | The UIElement. |
Returns
| Type | Description |
|---|---|
| System.Int32 | Row value of given object. |
GetRowSpan(UIElement)
Gets the value of the Syncfusion.UI.Xaml.Charts.RowSpan attached property from a given UIElement.
Declaration
public static int GetRowSpan(UIElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | element | The element from which to read the property value. |
Returns
| Type | Description |
|---|---|
| System.Int32 | The value of the Syncfusion.UI.Xaml.Charts.RowSpan attached property. |
OnBoxSelectionChanged(ChartSelectionChangedEventArgs)
Called when selection changed in SfChart.
Declaration
protected virtual void OnBoxSelectionChanged(ChartSelectionChangedEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartSelectionChangedEventArgs | eventArgs | ChartSelectionChangedEventArgs. |
OnRootPanelSizeChanged(Size)
Called when root panel size changed.
Declaration
protected virtual void OnRootPanelSizeChanged(Size size)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.Foundation.Size | size | The size. |
OnSelectionChanged(ChartSelectionChangedEventArgs)
Called when selection changed in SfChart.
Declaration
protected virtual void OnSelectionChanged(ChartSelectionChangedEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartSelectionChangedEventArgs | eventArgs | ChartSelectionChangedEventArgs. |
OnSelectionChanging(ChartSelectionChangingEventArgs)
It's a preview event before SelectionChanged.
Declaration
protected virtual void OnSelectionChanging(ChartSelectionChangingEventArgs eventArgs)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartSelectionChangingEventArgs | eventArgs | ChartSelectionChangingEventArgs |
OnSeriesBoundsChanged(ChartSeriesBoundsEventArgs)
Event invokes when the plot area size changed.
Declaration
protected virtual void OnSeriesBoundsChanged(ChartSeriesBoundsEventArgs args)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartSeriesBoundsEventArgs | args | Which indicates ChartSeriesBoundsEventArgs. |
PointToValue(ChartAxis, Point)
Converts screen point to chart value.
Declaration
public virtual double PointToValue(ChartAxis axis, Point point)
Parameters
| Type | Name | Description |
|---|---|---|
| ChartAxis | axis | The axis value. |
| Windows.Foundation.Point | point | The point. |
Returns
| Type | Description |
|---|---|
| System.Double | The double point to value. |
Print()
Declaration
public void Print()
ResumeSeriesNotification()
Processes the data that is added to the data source after the SuspendSeriesNotification is called.
Declaration
public void ResumeSeriesNotification()
Save()
Exports the SfChart as image in the selected location by using FileSavePicker.
Declaration
public void Save()
Save(String, StorageFolder)
Export the SfChart as image with the given name and the specified location.
Declaration
public void Save(string fileName, StorageFolder folderLocation)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | fileName | Name of the image file. |
| Windows.Storage.StorageFolder | folderLocation | Specifies the location to save. Default location:Installed Location. |
Save(IRandomAccessStream, Guid)
Export the SfChart as image using the stream and encoder.
Declaration
public void Save(IRandomAccessStream stream, Guid bitmapEncoderID)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.Storage.Streams.IRandomAccessStream | stream | Image Stream |
| System.Guid | bitmapEncoderID | BitmapEncoder ID |
Serialize(Stream)
Method used to serialize the chart.
Declaration
public void Serialize(Stream stream)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IO.Stream | stream |
Serialize(StorageFile)
Method used to generate a serialize file in default location.
Declaration
public void Serialize(StorageFile file)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.Storage.StorageFile | file | Used to specify storage file. |
SeriesSelectedIndexChanged(Int32, Int32)
Method used to highlight selected index series.
Declaration
public virtual 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. |
SetColumn(UIElement, Int32)
Set column to ChartAxis.
Declaration
public static void SetColumn(UIElement obj, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | obj | The UIElement. |
| System.Int32 | value | Column value of the object. |
SetColumnSpan(UIElement, Int32)
Sets the value of the Syncfusion.UI.Xaml.Charts.ColumnSpan attached property to a given UIElement.
Declaration
public static void SetColumnSpan(UIElement element, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | element | The element on which to set the Syncfusion.UI.Xaml.Charts.ColumnSpan attached property. |
| System.Int32 | value | The property value to set. |
SetRow(UIElement, Int32)
Method implementation for set row value to ChartAxis.
Declaration
public static void SetRow(UIElement obj, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | obj | The UIElement. |
| System.Int32 | value | Row value of the object. |
SetRowSpan(UIElement, Int32)
Sets the value of the Syncfusion.UI.Xaml.Charts.RowSpan attached property to a given UIElement.
Declaration
public static void SetRowSpan(UIElement element, int value)
Parameters
| Type | Name | Description |
|---|---|---|
| Windows.UI.Xaml.UIElement | element | The element on which to set the Syncfusion.UI.Xaml.Charts.RowSpan attached property. |
| System.Int32 | value | The property value to set. |
SuspendSeriesNotification()
Suspends all the series from updating the data till ResumeSeriesNotification is called. It is specifically used when you need to append the collection of data.
Declaration
public void SuspendSeriesNotification()
ValueToPoint(ChartAxis, Double)
Converts the chart value to screen point.
Declaration
public virtual 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. |
Events
PropertyChanged
Event correspond to property value changed. It invokes when the ChartBase properties changed.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type |
|---|
| System.ComponentModel.PropertyChangedEventHandler |
SelectionChanged
Event correspond to series and segment selection. It invokes once selection changed from a series or segment.
Declaration
public event EventHandler<ChartSelectionChangedEventArgs> SelectionChanged
Event Type
| Type |
|---|
| System.EventHandler<ChartSelectionChangedEventArgs> |
Remarks
SelectionChanging
Event correspond to series and segment selection. It invokes before selection changing from a series or segment.
Declaration
public event EventHandler<ChartSelectionChangingEventArgs> SelectionChanging
Event Type
| Type |
|---|
| System.EventHandler<ChartSelectionChangingEventArgs> |
Remarks
SeriesBoundsChanged
Event correspond to plot area bound. It invokes when the plot area size changes.
Declaration
public event EventHandler<ChartSeriesBoundsEventArgs> SeriesBoundsChanged
Event Type
| Type |
|---|
| System.EventHandler<ChartSeriesBoundsEventArgs> |