New to Telerik UI for .NET MAUI? Start a free 30-day trial

Represents the abstract base class for all chart series types that can be added to the Series collection of a RadChartBase.

A ChartSeries is a lightweight, UI-independent data descriptor rather than a visual element: it declares which data to plot and how, but the actual layout and drawing are performed by the chart engine when the owning RadChartBase composes its render model. Because of this, a single series instance can safely be shared across multiple plot areas of the same chart, and adding it more than once to Series is tracked using a reference count rather than causing duplicate subscriptions.

All members of this type are intended to be accessed from the UI thread that owns the chart; the class does not perform any internal synchronization.

Definition

Namespace:Telerik.Maui.Controls.Charts

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public abstract class ChartSeries : StyleableElement

Inheritance: objectChartSeries

Derived Classes: CartesianSeriesPieSeries

Constructors

Initializes a new instance of the ChartSeries class.

C#
public ChartSeries()

Fields

DisplayNameProperty

BindableProperty

Identifies the DisplayName bindable property.

C#
public static readonly BindableProperty DisplayNameProperty

IsVisibleProperty

BindableProperty

Identifies the IsVisible bindable property.

C#
public static readonly BindableProperty IsVisibleProperty

ItemsSourceProperty

BindableProperty

Identifies the ItemsSource bindable property.

C#
public static readonly BindableProperty ItemsSourceProperty

PlotAreaProperty

BindableProperty

Identifies the PlotArea bindable property.

C#
public static readonly BindableProperty PlotAreaProperty

StyleProperty

BindableProperty

Identifies the Style bindable property.

C#
public static readonly BindableProperty StyleProperty

Properties

Gets or sets the display name presented for this series in chart legends, tooltips, and other UI surfaces that identify individual series to the user. This value has no effect on layout or rendering of the series data itself.

C#
public string DisplayName { get; set; }

Gets or sets a value indicating whether this series participates in chart layout and rendering. Setting this property to false excludes the series from the plotted data entirely (including axis range calculation), as opposed to merely hiding its visuals, and triggers a chart redraw.

C#
public bool IsVisible { get; set; }

Gets or sets the collection of data items rendered by this series. Each derived series type reads specific members from every item (for example via HorizontalBinding and VerticalBinding) to resolve the plotted values.

C#
public IEnumerable ItemsSource { get; set; }

When the series is part of an active chart and the assigned collection implements INotifyCollectionChanged, the series automatically subscribes to CollectionChanged so that additions, removals, and resets trigger a chart redraw. The subscription is created and torn down as the series is attached to or detached from the chart, so assigning a new collection while the series is not attached does not leak subscriptions.

Gets or sets the named PlotArea that hosts this series when the owning chart defines multiple plot areas. Leave this property null to plot the series in the chart's default plot area (the first entry in PlotAreas, or an implicit single plot area when none are declared).

C#
public ChartPlotArea PlotArea { get; set; }

Style

Style

Gets or sets the style merged with the annotation's implicit and theme styles.

C#
public Style Style { get; set; }

Methods

Called after the value of IsVisible changes. Override this method in a derived class to react to visibility changes beyond the default chart invalidation behavior already performed by the base implementation.

C#
protected virtual void OnIsVisibleChanged()

Called after the value of ItemsSource changes. The base implementation unsubscribes from change notifications on oldValue and, if the series is currently attached to a chart and newValue implements INotifyCollectionChanged, subscribes to it. Override this method to perform additional processing when the underlying data source is replaced.

C#
protected virtual void OnItemsSourceChanged(IEnumerable oldValue, IEnumerable newValue)
Parameters:oldValueIEnumerable

The previously assigned data source, or null if none was set.

newValueIEnumerable

The newly assigned data source, or null to clear the series data.

Called when the collection currently assigned to ItemsSource raises CollectionChanged while the series is attached to a chart. The base implementation raises a property-changed notification for ItemsSource so that the owning chart invalidates and rebuilds its render model. Override this method to perform additional, more granular handling of collection mutations.

C#
protected virtual void OnItemsSourceCollectionChanged(object sender, NotifyCollectionChangedEventArgs e)
Parameters:senderobject

The collection that raised the change notification.

eNotifyCollectionChangedEventArgs

The event data describing the change that occurred.