Attributes Controls
Add a New Series
This page describes how to add a series.
The attributes 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 a u-Chart (named ucChart in the
examples below). The process is similar for the other charts:
[Visual Basic]
' Create a new series
Dim series As New uSeries("Series 1")
' Add the series to the collection
ucChart.SeriesCollection.Add(series)
' An alternative is to add the series directly to the collection
ucChart.SeriesCollection.Add("Series 1")
[Visual C#]
// Create a new series
uSeries series = new uSeries("Series 1");
// Add the series to the collection
ucChart.SeriesCollection.Add(series);
// An alternative is to add the series directly to the collection
ucChart.SeriesCollection.Add("Series 1");
After the series has been added, samples may then be added to the
series. Adding samples is discussed
here. The first series of the chart can be referenced via ucChart.SeriesCollection[0]. The resulting
chart should look similar to the following:
Add More than One Series
The attributes controls support multiple series. Just add more series to the series collection.
[Visual Basic]
' Create a new series
series = New uSeries("Series 2")
' Add the series to the collection
ucChart.SeriesCollection.Add(series)
' An alternative is to add the series directly to the collection
ucChart.SeriesCollection.Add("Series 2")
[Visual C#]
// Create a new series
series = new uSeries("Series 2");
// Add the series to the collection
ucChart.SeriesCollection.Add(series);
// An alternative is to add the series directly to the collection
ucChart.SeriesCollection.Add("Series 2");
The nth series of the chart can be referenced via ucChart.SeriesCollection[n]. The resulting
chart should look similar to the following after data has been added to the series: