Lesson 4 - Use a Series Template for Auto-Created Series
4 min to read
This document provides step-by-step instructions on how to create a Web application with a WebChartControl control bound to data. In this example, all series will be auto-created by a chart using a series template, which specifies common data binding properties for all series.
This is possible because the data for all series (the series' names along with series' points' arguments and values) are stored in the same data table. Also, in this example the series view type and other settings should be the same for all series to be created.
In this example, you will use the "GSP" table in the GSP database (the gsp.mdb file shipped with the ASP.NET Chart Control installation). This table contains the Gross State Product (GSP) statistics for various US regions.
In the Save the Connection String to the Application Configuration File window, click Next>.
Leave the next page as is, and click Next>.
On the last page, you can test the database connection by clicking Test Query.
Click Finish to create the datasource.
The DataSource object is now assigned to the chart.
Specify a Series Data Member and Adjust a Series Template
Since in this example, the chart will represent the data as different series, series points and their values, all series will be created using a series template that is common to all of them. The following steps demonstrate how this can be done.
By default, the crosshair cursor argument line and crosshair common label are displayed on a chart. You can disable (or enable) a crosshair cursor both at the level of a chart via the WebChartControl.CrosshairEnabled property and at the level of a chart series using the SeriesBase.CrosshairEnabled property.