[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Collapse]Charts Suite
   [Collapse]Chart Control
    [Expand]Getting Started
    [Expand]Fundamentals
    [Expand]Providing Data
    [Collapse]Chart Elements
     [Expand]Diagram
     [Collapse]Series
       Series Points
       Series Point Labels
      [Expand]Indicators
       Series Titles
       Total Labels
     [Expand]Panes
     [Expand]Axes
      Legends
      Chart Titles
      Annotations
    [Expand]Appearance Customization
    [Expand]End-User Features
    [Expand]Design-Time Features
    [Expand]Examples
    [Expand]Additional Resources
   [Expand]Chart3D Control
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Expand]Navigation Controls
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Series

A series is a group of data points that have the same argument and value types. The series type determines the number of values that are required to define a point; it also specifies point appearance. Series can also have additional series elements that help analyze data and provide extra information; series also allow you to filter data before displaying it in a chart.

The following image displays the Area, Line and Side-by-Side Bar series in a 2D XY Diagram:

This document consists of the following sections:

Expanded How to: Create Series

Use one of the approaches below to add series to a chart.

Manually Create a Series

The following example shows how to add an empty series to a chart:

The table below lists classes and properties used by the markup above:

Diagram.Series

The diagram series' collection. The context property: you can declare series directly after a diagram's declaration in XAML.

Series

The base class for all individual series in the chart.

Create a Series From a Data Source

The following code generates series from a data source:

The markup above uses the following classes and properties:

Member

Description

ChartControl.DataSource

Gets or sets the chart control's data source.

Diagram.SeriesTemplate

Specifies the series template settings.

Diagram.SeriesDataMember

Gets or sets the name of the data field whose values are used to automatically generate and populate series.

The Chart control performs the following to generate series from a data source:

  1. Groups data source items by an item field the SeriesDataMember property specifies.
  2. Creates the same number of series as formed groups, and equals the number of the series data member unique values.
  3. Assigns a unique group for each series: Series.DisplayName set to the string representation of the SeriesDataMember value, and the series uses group items to automatically populate series with points.

Expanded How to: Populate a Series with Data

The series displays data you provide. This section describes methods you can use to populate series with data:

Manually Add Points to a Series

The following markup adds a Line series with five manually added Series Points:

The markup above uses the following classes and properties:

Member

Description

Series.Points

The series's collection of points.

SeriesPoint

An individual point.

Note that several series require more than one Value per point to display data. These series provide attached properties to specify additional values:

Series

Attached Property

Bubble

BubbleSeries2D.Weight

Stock

Candle Stick

FinancialSeries2D.OpenValue

FinancialSeries2D.HighValue

FinancialSeries2D.LowValue

FinancialSeries2D.CloseValue

Note that the point's value should not be specified for the financial series.

Side-by-Side Range Bar

Overlapped Range Bar

RangeBarSeries2D.Value2

Range Area

RangeAreaSeries2D.Value2

Range Polar Area

PolarRangeAreaSeries2D.Value2

Range Radar Area

RadarRangeAreaSeries2D.Value2

Populate a series with data from a data source

The following code populates a new series with points from the item collection that the chart's data context object provides:

This code utilizes the following classes and properties:

Member

Description

Series.DataSource

Specifies the series's data source.

Series.ArgumentDataMember

Gets or sets the name of the data field which contains arguments for generated series points.

Series.ValueDataMember

Gets or sets the name of the data field which contains values for generated series points.

To populate series with points from a data source, the chart control generates a series point for each data item. Then, series points use the argument data member's values as Argument values and the value data member's values as Value values.

Note that several series require more than one ValueDataMember specified to display data. The following table lists series that have specific ValueDataMember parameters:

Series

Parameters

Bubble

Series.ValueDataMember

BubbleSeries2D.WeightDataMember

Stock

Candle Stick

FinancialSeries2D.OpenValueDataMember

FinancialSeries2D.HighValueDataMember

FinancialSeries2D.LowValueDataMember

FinancialSeries2D.CloseValueDataMember

Side-by-Side Range Bar

Overlapped Range Bar

Series.ValueDataMember

RangeBarSeries2D.Value2DataMember

Range Area

Series.ValueDataMember

RangeAreaSeries2D.Value2DataMember

Range Polar Area

Range Radar Area

Series.ValueDataMember

CircularRangeAreaSeries2D.Value2DataMember

Important

The Series.Points property returns series points that represent data source values on a chart. The first time you access this property, the series generates series points when the chart/series is bound to data. It is recommended that you avoid using this property, because series point generation requires additional time to convert internal data objects to series points, which in turn can lead to control freezes.

Refer to the Lesson 3 - Bind Chart Series to Data topic for a step-by-step guide that explains how to create a chart, and bind it to a data source.

Expanded MVVM Binding

Use the Diagram.SeriesItemsSource property to bind a chart to a collection of series view models when your application uses the MVVM (Model-View-ViewModel) architecture. The Diagram.SeriesItemTemplate and Diagram.SeriesItemTemplateSelector properties specify how the chart converts view model objects to series.

The following code uses the MVVM architecture to populate the Chart Control with series:

The code above utilizes the properties below:

Member

Description

Diagram.SeriesItemsSource

Gets or sets the collection of objects used to generate series.

Diagram.SeriesItemTemplate

Gets or sets the System.Windows.DataTemplate that specifies how to convert a model object to a series.

Diagram.SeriesItemTemplateSelector

Gets or sets the custom logic for selecting a data template that converts a model object to a series.

Expanded Series Types

The Chart Control provides 2D and 3D series. The following sections list all available series:

Note that series of each type have unique specifics and settings. The control can only simultaneously display different types of series if they are compatible.

Expanded Series Elements

Element

Image

Series Point Labels

You can show points with labels to provide extra information, such as point arguments or values.

Total Labels

Total labels display summary values of several Bar Stacked or Pie series' points.

Indicators

Indicators help you to analyze and process series data visually.

Series Titles

A series title provides additional information on a series.

Colorize Series

The XYSeries.Brush property allows you to specify series color. The Area Series and Funnel Series provide the Border properties that contain the Brush property. This property specifies the series' border brush:

The following markup demonstrates how to specify a custom color for a series:

The classes and properties below configure series' colors:

Symbol

Description

XYSeries.Brush

Gets or sets the color of the XY-series.

AreaSeries2D.Border

AreaStackedSeries2D.Border

CircularAreaSeries2D.Border

Provides access to a series border's settings.

SeriesBorder

Contains settings the specify the appearance of a series border.

Important

The Chart Control can use only System.Windows.Media.SolidColorBrush objects to draw series.

Note

The pie/donut series and funnel series do not provide series color and you should utilize series points' brushes.

Tip

Use the ChartControl.BoundDataChanged event to specify colors of series generated via the Series Template.

Expanded See Also

Is this topic helpful?​​​​​​​