Log In
[Expand]Welcome to DevExpress .NET Documentation
[Collapse]WinForms Controls
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Collapse]Chart Control
   [Expand]Getting Started
   [Collapse]Providing Data
    [Collapse]Providing Data
      Manually Create a Series
      Manually Add Points to a Series
      Specify Series Data Members
      Automatic Series Creation
      Integration with a Data Grid, Vertical Grid, Tree List or List Box via ControlRowSource
      Pivot Charting (Integration with a Pivot Grid Control)
      Series Customization
      Series Scale Types
      Data Aggregation
    [Expand]Data Representation
   [Expand]Appearance Customization
   [Expand]End-User Features
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Additional Resources
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Report Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Automatic Series Creation

This document describes automatic series creation based on a template. For alternative approaches, refer to Manually Create a Series and Specify Series Data Members.

This document consists of the following sections:

Expanded Define a Template for an Auto-Created Series

Automatic series creation is the most uniform approach for providing chart data. This approach is used when the number of series is either unknown or too large.

The ChartControl.SeriesTemplate property provides access to an object that serves as a template for auto-created series.

When a data source is assigned to the ChartControl.DataSource property, define the name of a data column upon which new series will be created (and named), using the ChartControl.SeriesDataMember property.

Then assign the required data fields to the SeriesBase.ArgumentDataMember and SeriesBase.ValueDataMembers properties using the ChartControl.SeriesTemplate property. These properties determine the names of the data fields from which auto-created series should obtain data for their point arguments and values. Note that multiple values per series point are a prerequisite for series of some view types (e.g. Bubble or Stock), so in these cases you should assign a data field to each value level.

As with manually created series, you do not usually need to change the argument scale type of the SeriesBase.ArgumentScaleType property (set to Auto mode by default) because the type of series point argument is detected automatically, based on the underlying data type. If you wish to change the Numerical value scale type, use the SeriesBase.ValueScaleType property. For auto-created series, these properties reside within the ChartControl.SeriesTemplate property. To learn more on this, refer to Series Scale Types.

To learn more on series templates customization, refer to the next section of this document (Obtain and Customize an Auto-Created Series).

Expanded Obtain and Customize an Auto-Created Series

Use the SeriesBase.View property of the series template to define a common view type for an auto-created series. Note that it is not possible to determine a custom view type for an auto-created series at design time. At runtime, you can do this within the ChartControl.BoundDataChanged event handler. To learn more on this, refer to How to: Individually Change the View Type of Automatically Created Series.

Moreover, any setting that is customized using the ChartControl.SeriesTemplate property does not apply to series contained within the ChartControl.Series collection of a chart control. These settings are only in effect for auto-created series. So, as with the view type, you cannot obtain and customize an individual auto-created series at design time.

At runtime, to individually customize these series, you can access them in the specific ChartControl.BoundDataChanged event of the chart control. The following example demonstrates how a secondary axis can be assigned to an auto-created series.

In fact, you can access and customize the same options as for a manually created series using the ChartControl.SeriesTemplate property. To access these settings at runtime, use the following code.

The options available are detailed in the following document: Specify Series Data Members.

Below are descriptions for options specific to auto-created series.

The SeriesNameTemplate option of an auto-created series allows you to define prefix and postfix text for the series names that are dynamically created as a result of binding a chart control to data, using the ChartControl.SeriesNameTemplate property. Expand this property in the Properties window to access the SeriesNameTemplate.BeginText and SeriesNameTemplate.EndText properties.

Note that the settings available from the series name template are not applied to the data bound series contained within the ChartControl.Series collection of a chart control.

For an auto-created series, it is possible to define the order in which automatically generated series objects are sorted within the chart control, based on their dynamically created series names, which are taken from a data field specified by the ChartControl.SeriesDataMember property. So, to toggle between ascending and descending sort order of auto-created series, use the ChartControl.SeriesSorting property. For more information, refer to Sorting Data.

Expanded See Also

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