Each graphic on the chart represents a ChartSeries object. It holds data, which is used for calculating the coordinates of the graphics as well various style and appearance properties. All ChartSeries for a chart are kept in the Series property.
The following code creates a new series in a line chart, sets its data and adds it to the Series of the chart:
C#
![]() |
---|
LineSeries lSeries = new LineSeries(); |
VB.NET
![]() |
---|
Dim lSeries As LineSeries = New LineSeries |
Each ChartSeries has a Title property, which shows as a label in the ChartLegend should you use one.
The ChartSeries defines the Fills and Strokes used for painting the chart graphics that corresponds to this series. It also holds properties for labels drawn at the series - LabelFontFamily, LabelFontSize etc.
Line, Radar and Bar charts can have unlimited number of LineSeries and BarSeries. Pie and doughnut charts have just one, which is an instance of PieSeries. The order in which the series are added may influence the appearance of the chart.
![]() |
---|
When a chart control is dropped at the form, it is created with a default series in it. You should either remove it or modify it according to your needs. |