The data series of the Xceed Chart for WinForms component 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
Evaluation functionality is exposed by the Evaluate method of the DataSeries class. 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 another type, the component will raise an exception. The Evaluate command receives two arguments: the single argument function that will 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.
VB.NET | |
---|---|
|
C# | |
---|---|
// create a subset containing all values |
Supported Evaluation Functions
The first argument of the Evaluate method is a string argument representing the function that will be performed. The following table describes the result returned by the 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: Data Manipulation\General\Evaluating