Back to Devexpress

Series

windowsforms-6167-controls-and-libraries-chart-control-series.md

latest6.1 KB
Original Source

Series

  • Feb 01, 2021
  • 7 minutes to read

The Series is the chart element that represents data within the Chart Control. The series’s view specifies the data’s appearance. The Series’s elements (Series Labels, Series Titles and others) display additional information about series’ data. For example, The Series Titles show series names and allow end-users to identify the pie series within the Chart Control. The Series also provides a filtering and sorting functionality to filter and sort data before visualization.

This topic consists of the following sections:

Series Creation

Use one of the following approaches to add a series to the chart:

Individual Series Accessing

Each chart can contain an unlimited number of series. You can click on a series to access it at design time .

Use the following code to get access to an individual series at runtime:

csharp
// The series collection provides two ways to get an item:
// By index;
Series indexedSeries = chartControl.Series[0];
// By series name (the Name property value);
Series indexedSeries = chartControl.Series["Series name"];
vb
' The series collection provides two ways to get an item:
' By index;
Dim indexedSeries As Series = chartControl.Series(0)
' By series name;
Dim indexedSeries As Series = chartControl.Series("Series name")

The following table lists the properties used the code above:

SymbolDescription
ChartControl.SeriesProvides access to the chart control’s collection of series objects.
SeriesCollection.ItemProvides access to individual items that the collection stores.
Series.NameGets or sets the name of the series.

Data Providing

The series obtains the data it visualizes in the following ways:

Series View Changing

To change the series view at design time, select the series, locate the SeriesBase.View property in the Properties window and click the ellipsis button. In the invoked dialog window, select the series view and click OK.

Use the below code to change the series view at runtime:

csharp
series.View = new SplineSeriesView();
vb
series.View = New SplineSeriesView

The code above uses the following classes and properties:

SymbolDescription
SeriesBase.ViewGets or sets the view that the series uses to visualize its data.
SeriesViewBaseRepresents the base class for all series view objects.

Important

Series that the chart displays should have compatible series views. For example, the pie series view is not compatible with the area series view, and a chart cannot show these series simultaneously. In this case, the chart draws the first series in the collection.

Series Elements Customization

The following series elements that display additional information about series’ data are customizable:

|

Element and Description

|

Sample Image

| | --- | --- | |

Series Point Labels

Text labels that represent point’s values, for example arguments or values in percent.

|

| |

Total Labels

Total Labels show Stacked Bar series groups’ summary values or all pie points’ summary value.

|

| |

Series Titles

The Series Title accompanies a series and usually displays the series name. The Series Titles are designed to allow end-users to distinguish several series that the chart displays simultaneously and are available only for series that use the Pie, Doughnut or Funnel series view.

|

| |

Indicators

Indicators allow you to perform visual data analysis using the 2D XY-series data’s.

|

|