Back to Devexpress

Manually Add Points to a Series

windowsforms-5796-controls-and-libraries-chart-control-provide-data-manually-add-points-to-a-series.md

latest4.9 KB
Original Source

Manually Add Points to a Series

  • Feb 28, 2025
  • 4 minutes to read

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.

Add Series Points at Design Time

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.

Add Series Points at Runtime

The series’s point collection can be populated at runtime using the following approach:

csharp
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);
vb
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:

SymbolDescription
Series.PointsGets the series’ collection of data points.
SeriesPointCollection.AddAppends the specified SeriesPoint object to the current collection.
SeriesPointCollection.AddRangeAppends an array of series points to the collection.
SeriesPointCollection.AddPointAdds a point with the specified argument and value required to plot a series.
SeriesPointCollection.AddBubblePointAdds a point with the specified argument and values required to plot a series with a bubble series view.
SeriesPointCollection.AddRangePointAdds a point with the specified argument and values required to plot a series with a range series view.
SeriesPointCollection.AddGanttPointAdds a point with the specified argument and values required to plot a series with a Gantt series view.
SeriesPointCollection.AddFinancialPointAdds a point with the specified argument and values required to plot a series with a financial series view.
SeriesPointCollection.AddBoxPlotPointAdds a point with the specified argument and values required to plot a series with a Box Plot series view.