Read series' points.

Hi
How to read all the points of a series of a chart control.
Thanks

1 Reply

MK Muneesh Kumar G Syncfusion Team September 26, 2018 10:26 AM UTC

Hi Antonello, 
 
Greetings from Syncfusion, we have analyzed your requirement and we would like to inform you that Points property of ChartSeries is an indexer type property, so we can read the points similar to reading an Array or List using an index value. 
 
For more information about indexer type property, please refer the following link 
 
Please refer the following code snippet to achieve this 
 
[C#] 
 
        ChartPoint[] ReadChartPoints(ChartSeries series) 
        { 
            ChartPoint[] target = new ChartPoint[series.Points.Count]; 
            int count = 0; 
 
            //Read points in a series using foreach loop 
            foreach (ChartPoint point in series.Points) 
            { 
                target[count++] = point; 
            } 
 
            return target; 
        } 
 
        ChartPoint[] pointsArray = ReadChartPoints(this.chartControl1.Series[0]); 
 
 
We have prepared a simple sample based on your requirement and it is available in the following link 
 
 
Hope this helps. 
 
Regards, 
Muneesh Kumar G. 


Loader.
Up arrow icon