windowsforms-5796-controls-and-libraries-chart-control-provide-data-manually-add-points-to-a-series.md
This document explains how to populate a series with data points manually. This approach is useful when the chart should display a small number of points with known arguments and values. Note that data can be provided in this manner for manually created series only.
Important
The Chart Control does not display a Series unless it has any points.
The series can be populated with series points using one of the following ways:
Using the Chart Designer
Using the Series Collection Editor
The default SeriesBase.ArgumentScaleType property value ( Auto ) specifies that the series uses series point arguments to specify its argument’s scale type. Refer to the Series Scale Types topic to learn how to change the default scale types.
Refer to Series for more information about series options.
The series’s point collection can be populated at runtime using the following approach:
Series northSeries = chartControl.Series["DevAV North"];
northSeries.Points.AddRange(
new SeriesPoint(2007, 3.01),
new SeriesPoint(2008, 3.212),
new SeriesPoint(2009, 3.223),
// and another points.
);
// The Points collection provides Add...Point methods
// that allow you to add series points for different view types.
northSeries.Points.AddPoint(2011, 2.612);
northSeries.Points.AddBubblePoint(2011, 2.612, 1.0);
Dim northSeries As Series = chartControl.Series("DevAV North")
northSeries.Points.AddRange( _
new SeriesPoint(2007, 3.01), _
new SeriesPoint(2008, 3.212), _
new SeriesPoint(2009, 3.223), _
' and another points.
)
' The Points collection provides Add...Point methods
' that allow you to add series points for different view types.
northSeries.Points.AddPoint(2011, 2.612)
northSeries.Points.AddBubblePoint(2011, 2.612, 1)
The following table lists the properties and methods in the code snippets above:
| Symbol | Description |
|---|---|
| Series.Points | Gets the series’ collection of data points. |
| SeriesPointCollection.Add | Appends the specified SeriesPoint object to the current collection. |
| SeriesPointCollection.AddRange | Appends an array of series points to the collection. |
| SeriesPointCollection.AddPoint | Adds a point with the specified argument and value required to plot a series. |
| SeriesPointCollection.AddBubblePoint | Adds a point with the specified argument and values required to plot a series with a bubble series view. |
| SeriesPointCollection.AddRangePoint | Adds a point with the specified argument and values required to plot a series with a range series view. |
| SeriesPointCollection.AddGanttPoint | Adds a point with the specified argument and values required to plot a series with a Gantt series view. |
| SeriesPointCollection.AddFinancialPoint | Adds a point with the specified argument and values required to plot a series with a financial series view. |
| SeriesPointCollection.AddBoxPlotPoint | Adds a point with the specified argument and values required to plot a series with a Box Plot series view. |