[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
   Getting Started
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Reporting
  [Collapse]Chart Control
   [Expand]Product Information
   [Expand]Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Collapse]Creating Charts
     [Expand]2D Chart Types
     [Expand]3D Chart Types
     [Collapse]Providing Data
       Manually Create a Series
       Manually Add Points to a Series
       Specify Series Data Members
       Automatic Series Creation
       Customize a Series
       Series Scale Types
       Pivot Charting (Integration with a Pivot Grid Control)
       Colorizer
     [Expand]Data Representation
     [Expand]Appearance Customization
     [Expand]Miscellaneous
    [Expand]Chart Elements
    [Expand]End-User Interaction
     Supported Browsers
     Adding a Web Chart
     Handling Client-side Scripts
     Medium Trust Support
     Web Farm and Web Gardens Support
   [Expand]Design-Time Features
   [Expand]Visual Elements
   [Expand]Examples
  [Expand]Pivot Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Scheduler
  [Expand]Site Navigation and Layout
  [Expand]HTML Editor
  [Expand]Gauges
  [Expand]Vertical Grid
  [Expand]Data Editors
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Controls
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[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)

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 WebChartControl.SeriesTemplate property provides access to an object that serves as a template for auto-created series.

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

Then assign the required data fields to the SeriesBase.ArgumentDataMember and SeriesBase.ValueDataMembers properties using the WebChartControl.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 charts), 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 WebChartControl.SeriesTemplate property. For more information, see Series Scale Types.

To learn more on series template 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 WebChartControl.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 WebChartControl.SeriesTemplate property does not apply to series contained within the WebChartControl.Series collection of a web 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 WebChartControl.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 WebChartControl.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 WebChartControl.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 WebChartControl.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 WebChartControl.SeriesDataMember property. So, to toggle between ascending and descending sort order for an auto-created series, use the WebChartControl.SeriesSorting property. For more information, refer to Sorting Data.

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