Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.DataManipulation.v4.4 Assembly / Xceed.Chart.DataManipulation Namespace / FunctionCalculator Class / Calculate Method
Example


In This Topic
    Calculate Method
    In This Topic
    Calculates a function which is defined by the current expression and arguments.
    Syntax
    'Declaration
     
    Public Function Calculate() As DataSeries
    'Usage
     
    Dim instance As FunctionCalculator
    Dim value As DataSeries
     
    value = instance.Calculate()
    public DataSeries Calculate()

    Return Value

    The function returns an DataSeries object which contains the result of the calculation. If the expression is empty the function returns null.
    Exceptions
    ExceptionDescription
    Raised if there are some invalid arguments or a syntax error in the expression.
    Example
    The following code Calculates a function and presents the result data in a line chart.
    // ... setup the lineSeries
    // ... setup the functionCalculator (arguments and expression)
    
     lineSeries.Values = functionCalculator.Calculate();
     lineSeries.Values.ValueFormat.Format = ValueFormat.Custom;
     lineSeries.Values.ValueFormat.CustomFormat = "0.00";
    
     chartControl.Refresh();
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also