New to Telerik UI for WinUI? Download free 30-day trial

Overview

The dynamic number of series is a feature that allows you to data bind the chart to a collection of business objects holding information about the series and their data points. This feature is similar to the ItemsSource usage in the item controls in the framework (like ListBox, ComboBox, etc.).

The feature is enabled with the ChartSeriesProvider class which is assigned to the SeriesProvider property of RadCartesianChart and RadPolarChart. The provider allows you to provide a collection of series models using its Source property. The chart series are described using the ChartSeriesDescriptor class and its concrete implementations.

Multiple chart series generated with the series provider

WinUI RadChart Dynamic Series Using Collection View Models

See examples on the ChartSeriesProvider usage in the Using SeriesProvider article.

Series Descriptors

The series descriptors are a mediator between the series view models and the chart series visuals (like LineSeries, AreaSeries, etc.). The series provider introduces the following descriptors:

  • CategoricalSeriesDescriptor—Represents a series descriptor used to create the categorical chart series variations.
  • ScatterSeriesDescriptor—Represents a series descriptor used to create the scatter chart series variations.
  • OhlcSeriesDescriptor—Represents a series descriptor used to create the financial chart series variations.

Each descriptor share the following set of properties:

  • TypePath—Sets a string value representing the name of a property that points to the series type that needs to be created. The property that holds the type value can contain an object of type System.Type with the corresponding series type or it can contain a string value that can be converted using the TypeConverter property of the descriptor.
  • Style—Sets the Style that describes the appearance of the series. If no TypePath is specified, the TargetType property of the Style object is used to generate the desired series.
  • ItemsSourcePath—Sets a string value that represents the name of the items source property that will feed the generated series.
  • CollectionIndex—Sets the index within the source collection of data (view models) for which the current descriptor should be used. This property is useful when, for example, a BarSeries needs to be generated for the first data entry and LineSeries for the rest of the entries.

The CategoricalSeriesDescriptor provides the following set of properties:

  • CategoryPath—Sets the name of the property that points to the Category value of the data point view model.
  • ValuePath—Sets the name of the property that points to the Value value of the data point view model.

The default type of series that will be created with the categorical descriptor is BarSeries.

The ScatterSeriesDescriptor provides the following set of properties:

  • XValuePath—ets the name of the property that points to the XValue value of the data point view model.
  • YValuePath—ets the name of the property that points to the YValue value of the data point view model.

The default type of series that will be created with the scatter descriptor is ScatterPointSeries.

The OhlcSeriesDescriptor provides the following set of properties:

  • CategoryPath—Sets the name of the property that points to the Category value of the data point view model.
  • OpenPath—Sets the name of the property that points to the Open value of the data point view model.
  • HighPath—Sets the name of the property that points to the High value of the data point view model.
  • LowPath—Sets the name of the property that points to the Low value of the data point view model.
  • ClosePath—Sets the name of the property that points to the Close value of the data point view model.

The default type of series that will be created with the OHLC descriptor is CandleStickSeries.

In this article
Not finding the help you need?