Time Series Controls
Add a New Series
This page describes how to add a series.
The time series controls of the .Net Analytics package include the following:
The series classes of the respective charts are:
The first step is to include the necessary namespaces
for the controls.
Add a Single Series
Below, we will add a new series to an Individuals chart (named indChart in the
examples below). The process is similar for the other charts:
[Visual Basic]
' Create a new series
Dim isSeries As New IndSeries("Series 1")
' Add the series to the collection
indChart.SeriesCollection.Add(isSeries)
' An alternative is to add the series directly to the collection
indChart.SeriesCollection.Add("Series 1")
[Visual C#]
// Create a new series
IndSeries isSeries = new IndSeries("Series 1");
// Add the series to the collection
indChart.SeriesCollection.Add(isSeries);
// An alternative is to add the series directly to the collection
indChart.SeriesCollection.Add("Series 1");
After the series has been added, samples or subgroups may then be added to the
series. Adding samples and subgroups is discussed
here and here respectively. The first series of the chart can be referenced via indChart.SeriesCollection[0]. The resulting
chart should look similar to the following:
Add More than One Series
The time series controls support multiple series. Just add more series to the series collection.
[Visual Basic]
' Create a new series
isSeries = New IndSeries("Series 2")
' Add the series to the collection
indChart.SeriesCollection.Add(isSeries)
' An alternative is to add the series directly to the collection
indChart.SeriesCollection.Add("Series 2")
[Visual C#]
// Create a new series
isSeries = new IndSeries("Series 2");
// Add the series to the collection
indChart.SeriesCollection.Add(isSeries);
// An alternative is to add the series directly to the collection
indChart.SeriesCollection.Add("Series 2");
The nth series of the chart can be referenced via indChart.SeriesCollection[n]. The resulting
chart should look similar to the following after data has been added to the series: