Category / Section
How to add data to the Chartcontrol?
1 min read
After placing the Charcontrol from the toolbar, ChartSeries class must be declared and points can be added to that series using Add method. Finally the series would to added to the Chartcontrol class. By default, colum chart would be displayed.
C#
ChartSeries series = this.chartControl1.Model.NewSeries("Series 1");
series.Points.Add(1, 410);
series.Points.Add(2, 420);
series.Points.Add(3, 430);
series.Points.Add(4, 440);
series.Points.Add(5, 450);
this.chartControl1.Series.Add(series);
VB
Dim series As ChartSeries = Me.chartControl1.Model.NewSeries("Series1")
series.Points.Add(1, 410)
series.Points.Add(2, 420)
series.Points.Add(3, 430)
series.Points.Add(4, 440)
series.Points.Add(5, 450)
Me.chartControl1.Series.Add(series)