The evaluation functionality is exposed by the Evaluate method of the NDataSeries class. The evaluation operations can be performed only on data series of type Double. If you attempt to execute the Evaluate method on a data series of other type the component will raise an exception. The Evaluate command receives two arguments - the single argument function which must be evaluated and the data series subset on which it must be performed. The method will return a double value representing the result of the function.
The following code retrieves the max value contained in the bar series Values data series.
C# |
Copy Code
|
---|---|
// create a subset containing all values NDataSeriesSubset subset; subset.AddRange(0, barseries.Values.Count); double dMaxValue = barseries.Values.Evaluate("MAX", subset); |
Visual Basic |
Copy Code
|
---|---|
' create a subset containing all values Dim subset As NDataSeriesSubset subset.AddRange(0, barseries.Values.Count) Dim dMaxValue As Double = barseries.Values.Evaluate("MAX", subset) |