Class ChartSeries
Serves as a base class for all types of chart series. Chart series is a visual representation of the data.
Namespace: Syncfusion.SfChart.XForms
Assembly: Syncfusion.SfChart.XForms.dll
Syntax
public abstract class ChartSeries : Element, IThemeElement
Constructors
ChartSeries()
Initializes a new instance of the ChartSeries class.
Declaration
public ChartSeries()
Fields
AnimationDurationProperty
Gets or sets the animation duration of chart series in seconds that delays the animation progress. This is a bindable property.
Declaration
public static readonly BindableProperty AnimationDurationProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ColorModelProperty
Gets or sets the color schemes for a particular series. This is a bindable property.
Declaration
public static readonly BindableProperty ColorModelProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ColorProperty
Gets or sets the color of the series. This is a bindable property.
Declaration
public static readonly BindableProperty ColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
DataMarkerProperty
Gets or sets the position of the data markers in series. This is a bindable property.
Declaration
public static readonly BindableProperty DataMarkerProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
EnableAnimationProperty
Gets or sets the value that determines, whether to enable animation for the series.
Declaration
public static readonly BindableProperty EnableAnimationProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Remarks
This property is not supported for BoxAndWhiskerSeries and ErrorBarSeries.
EnableDataPointSelectionProperty
Gets or sets the value that indicates whether to allow the segment selection of the series. This is a bindable property.
Declaration
public static readonly BindableProperty EnableDataPointSelectionProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
EnableTooltipProperty
Gets or sets the value that indicates whether to show tooltip of the series on touch. This is a bindable property.
Declaration
public static readonly BindableProperty EnableTooltipProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
IsVisibleOnLegendProperty
Gets or sets the value that indicates whether to display information about the series in the legend. This is a bindable property.
Declaration
public static readonly BindableProperty IsVisibleOnLegendProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
IsVisibleProperty
Gets or sets the value that indicates whether the series is visible in the chart. This is a bindable property.
Declaration
public static readonly BindableProperty IsVisibleProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ItemsSourceProperty
Gets or sets the data source to the chart. This is a bindable property.
Declaration
public static readonly BindableProperty ItemsSourceProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LabelProperty
Gets or sets the text for the series label, which needs to be display in legend item as an identifier. This is a bindable property.
Declaration
public static readonly BindableProperty LabelProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
LegendIconProperty
Gets or sets the icon type for the series, which is displayed in legend. This is a bindable property.
Declaration
public static readonly BindableProperty LegendIconProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
ListenPropertyChangeProperty
Gets or sets the value that indicates whether to listen to the PropertyChanged event of data point object. This is a bindable property.
Declaration
public static readonly BindableProperty ListenPropertyChangeProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
OpacityProperty
Gets or sets the value that lies between 0 to 1, handles the transparency level of the series color. This is a bindable property.
Declaration
public static readonly BindableProperty OpacityProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SelectedDataPointColorProperty
Gets or sets the color of the selected segment of the series. This is a bindable property.
Declaration
public static readonly BindableProperty SelectedDataPointColorProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
SelectedDataPointIndexProperty
Gets or sets the index value of current selected data point. This is a bindable property.
Declaration
public static readonly BindableProperty SelectedDataPointIndexProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
StrokeWidthProperty
Gets or sets the width of the series stroke. This is a bindable property.
Declaration
public static readonly BindableProperty StrokeWidthProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
TooltipTemplateProperty
Gets or sets the TooltipTemplate
property. This property is used to customize the appearance of tooltip. This is a bindable property.
Declaration
public static readonly BindableProperty TooltipTemplateProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
XBindingPathProperty
Gets or sets the X
binding path in Items source. This is a bindable property.
Declaration
public static readonly BindableProperty XBindingPathProperty
Field Value
Type |
---|
Xamarin.Forms.BindableProperty |
Properties
AnimationDuration
Gets or sets the animation duration of chart series in seconds that delays the animation progress. This is a bindable property.
Declaration
public double AnimationDuration { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the double value. |
Color
Gets or sets the color that is used to change the appearance of chart series. This is a bindable property.
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Color as its value. |
ColorModel
Gets or sets the color schemes for a particular series. This is a bindable property.
Declaration
public ChartColorModel ColorModel { get; set; }
Property Value
Type |
---|
ChartColorModel |
Remarks
It's a read only property and we need to set the Palette
of the ChartColorModel class.
DataMarker
Gets or sets the position of the data markers in series. This is a bindable property.
Declaration
public ChartDataMarker DataMarker { get; set; }
Property Value
Type | Description |
---|---|
ChartDataMarker | This property takes the ChartDataMarker as its value. |
EnableAnimation
Gets or sets a value indicating whether to enable animation for the series.
Declaration
public bool EnableAnimation { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the boolean value. |
Remarks
This property is not supported for BoxAndWhiskerSeries and ErrorBarSeries.
EnableDataPointSelection
Gets or sets a value indicating whether to allow the segment selection of the series. This is a bindable property.
Declaration
public bool EnableDataPointSelection { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the boolean value. |
EnableTooltip
Gets or sets a value indicating whether to show tooltip of the series on touch. This is a bindable property.
Declaration
public bool EnableTooltip { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the boolean value. |
IsSelected
Gets a value indicating whether the series is selected or not.
Declaration
public bool IsSelected { get; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes a bool value. |
IsVisible
Gets or sets a value indicating whether the series is visible in the chart. This is a bindable property.
Declaration
public bool IsVisible { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the boolean value. |
IsVisibleOnLegend
Gets or sets a value indicating whether to display information about the series in the legend. This is a bindable property.
Declaration
public bool IsVisibleOnLegend { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the boolean value. |
ItemsSource
Gets or sets the data source to the chart. This is a bindable property.
Declaration
public object ItemsSource { get; set; }
Property Value
Type | Description |
---|---|
System.Object | This property takes the System.Collections.IList of ChartDataPoint as its value. |
Label
Gets or sets the text for the series label, which needs to be display in legend item as an identifier. This is a bindable property.
Declaration
public string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property takes the string value. |
LegendIcon
Gets or sets the icon type for the series, which is displayed in legend. This is a bindable property.
Declaration
public ChartLegendIcon LegendIcon { get; set; }
Property Value
Type | Description |
---|---|
ChartLegendIcon | This property takes the ChartLegendIcon value. |
ListenPropertyChange
Gets or sets a value indicating whether to listen to the PropertyChanged event of data point object. This is a bindable property. the data point object should be implemented the INotifyPropertyChanged.
Declaration
public bool ListenPropertyChange { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean | This property takes the bool value. |
Opacity
Gets or sets the value that lies between 0 to 1, handles the transparency level of the series color. This is a bindable property.
Declaration
public double Opacity { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the boolean value. |
SelectedDataPointColor
Gets or sets the color of the selected segment of the series. This is a bindable property.
Declaration
public Color SelectedDataPointColor { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.Color | This property takes the Color as its value. |
SelectedDataPointIndex
Gets or sets the index value of current selected data point. This is a bindable property.
Declaration
public int SelectedDataPointIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | This property takes the boolean value. |
StrokeWidth
Gets or sets the width of the series stroke. This is a bindable property.
Declaration
public double StrokeWidth { get; set; }
Property Value
Type | Description |
---|---|
System.Double | This property takes the double value. |
TooltipTemplate
Gets or sets the data template for the series tooltip. This property is used to customize the appearance of series tooltip. This is a bindable property.
Declaration
public DataTemplate TooltipTemplate { get; set; }
Property Value
Type | Description |
---|---|
Xamarin.Forms.DataTemplate | This property takes the DataTemplate value. |
XBindingPath
Gets or sets the X
binding path in Items source. This is a bindable property.
Declaration
public string XBindingPath { get; set; }
Property Value
Type | Description |
---|---|
System.String | This property takes the System.String as its value. |
Methods
Animate()
Method used to animate the series.
Declaration
public void Animate()
GetChartDataPoints()
Method used to get the collection of ChartDataPoint.
Declaration
public virtual IList<ChartDataPoint> GetChartDataPoints()
Returns
Type | Description |
---|---|
System.Collections.Generic.IList<ChartDataPoint> | Collection. |
GetDataPointIndex(Single, Single)
Gets the data point index under x and y coordinates.
Declaration
public int GetDataPointIndex(float pointX, float pointY)
Parameters
Type | Name | Description |
---|---|---|
System.Single | pointX | point x value. |
System.Single | pointY | point y value. |
Returns
Type | Description |
---|---|
System.Int32 | The index value of the data point. |
Remarks
Returns -1 if no data is at the given point.
OnBindingContextChanged()
Override this method to execute an action when the BindingContext changes.
Declaration
protected override void OnBindingContextChanged()
OnParentSet()
Method used to set the parent.
Declaration
protected override void OnParentSet()
ResumeNotification()
Processes the data that is added to the data source after the SuspendNotification is called.
Declaration
public void ResumeNotification()
SuspendNotification()
Suspends the series from updating the series data till ResumeNotification is called. This is specifically used when you need to append the collection of data.
Declaration
public void SuspendNotification()
Events
DataMarkerLabelCreated
This event is raised when the data marker label is created. The individual data marker can be customized from this event based on condition.
Declaration
public event EventHandler<ChartDataMarkerLabelCreatedEventArgs> DataMarkerLabelCreated
Event Type
Type |
---|
System.EventHandler<ChartDataMarkerLabelCreatedEventArgs> |