We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to perform Utility functions using chart?

Platform: WinForms |
Control: Chart |
Published Date: February 20, 2015 |
Last Revised Date: June 25, 2019
Tags: common, formulas

 

Using UtilityFunctions class we can perform Gamma, factorial, Beta and other functions used in statistical distributions formulas.

We can perform the following utility analysis in chart,

  • Normal Distribution - The Normal Distribution method returns the Normal distribution for a given value.
  • T Cumulative Distribution - The T Cumulative Distribution method returns the T Cumulative distribution for a given value.
  • F Cumulative Distribution - The F Cumulative Distribution method returns the FCumulative distribution for a given value.

C#

//Perform T Cumulative Distribution : Initializes the T distribution series.

series = this.chartControl1.Model.NewSeries("T Distribution",ChartSeriesType.SplineArea);

series.Text = series.Name;

//Set the degree of freedom.

n = 2;

//Calculates the Beta function.

beta = UtilityFunctions.Beta(0.5, n / 2.0);

// Calculate coefficient of T Distribution.

coef = Math.Pow(n, -0.5) / beta;

// Calculate Data Points

for (int x = -120; x <= 120; x++)

{

doubleX = x / 10.0;

y = coef / Math.Pow(1.0 + doubleX * doubleX / n, (n + 1.0) / 2.0);

//Add data points to the series.

series.Points.Add(doubleX, y);

}

//Add the series to the chart series collection.

this.chartControl1.Series.Add(series);

VB

'Perform T Cumulative Distribution : Initializes the T distribution series.

series = Me.chartControl1.Model.NewSeries("T Distribution",ChartSeriesType.SplineArea)

series.Text = series.Name

'Set the degree of freedom.

n = 2

'Calculates the Beta function.

beta = UtilityFunctions.Beta(0.5, n / 2.0)

' Calculate coefficient of T Distribution.

coef = Math.Pow(n, -0.5) / beta

' Calculate Data Points

Do

doubleX = x / 10.0

y = coef / Math.Pow(1.0 + doubleX * doubleX / n, (n + 1.0) / 2.0)

'Add data points to the series.

series.Points.Add(doubleX, y)

Loop

'Add the series to the chart series collection.

Me.chartControl1.Series.Add(series)

This is illustrated in the Chart UG in this topic:

Utility Formulas

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon