0

I have

Chart1["Series1"]
Chart1["Series2"] ....

It has multiple Series and each series has Several Data points.

I want to find the count ( not sum but number of datapoints ) of Data points in all the series using LINQ.

Currently i do

var count = from s in Chart1.Series
            select new int[] { s.Points.Count };

And then for each thorough count and find the sum. Is there a better way to do this

abatishchev
  • 98,240
  • 88
  • 296
  • 433
Quantbuff
  • 827
  • 7
  • 9

1 Answers1

2

Try this:

var total = Chart1.Series.Sum(s => s.Points.Count);
Cameron
  • 96,106
  • 25
  • 196
  • 225