How to I set Custom Databinding in Chart?
We can bind the data using IChartSeriesModel interface. This interface requires the implementation of one property, two methods and one optional event. So, we easily provide a custom implementation of this interface.
C#
//Creating series data and binding to the array model
ChartSeries series1 = this.chartControl1.Model.NewSeries("Series 1");
series1.SeriesIndexedModelImpl = new ArrayModel(new double[]{22,24,32,12,18});
series1.Type = ChartSeriesType.Bar;
this.chartControl1.Series.Add(series1);
VB
'Creating series data and binding to the array model
Dim series1 As ChartSeries = Me.chartControl1.Model.NewSeries("Series 1")
series1.SeriesIndexedModelImpl = New ArrayModel(New Double(){22,24,32,12,18})
series1.Type = ChartSeriesType.Bar
Me.chartControl1.Series.Add(series1)
This is illustrated in the Chart UG in this topic: