Chart for .NET / User's Guide / Data Manipulation / Subset Operations / Evaluating

Evaluating

The data series of Nevron Chart for .NET have built-in support for evaluating a subset of its data. In general evaluating represents the ability to execute a single argument function on a subset of the data contained in the data series.

 Performing an Evaluate operation

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)
 Supported Functions

The first argument of the Evaluate method is a string argument representing the function that must be performed. The following table describes the result which is returned by the supported functions.

Function Result
MIN The minimum value contained in the subset
MAX The maximum value contained in the subset
AVE The average value contained in the subset
SUM The sum of the values contained in subset
ABSSUM The absolute sum of the values contained in the subset
FIRST The first value contained in the subset
LAST The last value contained in the subset
 Related Examples
Windows forms: All Examples\Data Manipulation\General\Evaluating
See Also