Scatter Plot Control
Add a New Series
This page describes how to add a scatter plot series. The scatter plot control of the .Net Analytics package is of the following type:
The series class of the scatter plot is:
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 Scatter plot (named spPlot in the
examples below). The process is similar for the other charts:
[Visual Basic]
' Create a new series
Dim spsSeries As New ScatterPlotSeries("Series 1")
' Add the series to the collection
spPlot.SeriesCollection.Add(spsSeries)
' An alternative is to add the series directly to the collection
spPlot.SeriesCollection.Add("Series 1")
[Visual C#]
// Create a new series
ScatterPlotSeries spsSeries = new ScatterPlotSeries("Series 1");
// Add the series to the collection
spPlot.SeriesCollection.Add(spsSeries);
// An alternative is to add the series directly to the collection
spPlot.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 spPlot.SeriesCollection[0]. The resulting
chart should look similar to the following:
Add More than One Series
The scatter plot control supports multiple series. Just add more series to the series collection.
[Visual Basic]
' Create a new series
spsSeries = New ScatterPlotSeries("Series 2")
' Add the series to the collection
spPlot.SeriesCollection.Add(spsSeries)
' An alternative is to add the series directly to the collection
spPlot.SeriesCollection.Add("Series 2")
[Visual C#]
// Create a new series
spsSeries = new ScatterPlotSeries("Series 2");
// Add the series to the collection
spPlot.SeriesCollection.Add(spsSeries);
// An alternative is to add the series directly to the collection
spPlot.SeriesCollection.Add("Series 2");
The nth series of the chart can be referenced via spPlot.SeriesCollection[n]. The resulting
chart should look similar to the following after data has been added to the series: