Articles in this section
Category / Section

How to perform statistical utility functions using WinForms Chart?

5 mins read

In the Syncfusion® WinForms Charts, the UtilityFunctions class allows you to perform Gamma, factorial, Beta and other functions commonly used in statistical distribution formulas.

We can perform the following utility analysis in chart, Using the UtilityFunctions class

C#

ChartSeries series = new ChartSeries("T-Distribution", ChartSeriesType.SplineArea);

//Set the degrees of freedom
double n = 2;

//Calculate the Beta function using Syncfusion's UtilityFunctions
var beta = UtilityFunctions.Beta(0.5, n / 2.0);

//Calculate the constant coefficient for the t-distribution formula
var coef = Math.Pow(n, -0.5) / beta;

//Generate points for the distribution curve
for (double x = -5; x <= 5; x += 0.1)
{
    var y = coef * Math.Pow(1 + (x * x) / n, -(n + 1.0) / 2.0);
    series.Points.Add(x, y);
}
this.chartControl1.Series.Add(series);

VB

Dim ChartSeries1 = New ChartSeries("T-Distribution", ChartSeriesType.SplineArea)

'Set the degrees of freedom
Dim n = 2

'Calculate the Beta function using Syncfusion's UtilityFunctions
Dim beta = UtilityFunctions.Beta(0.5, n / 2.0)

'Calculate the constant coefficient for the t-distribution formula
Dim coef = Math.Pow(n, -0.5) / beta

'Generate points for the distribution curve
For x As Double = -5 To 5 Step 0.1
    Dim y As Double = coef * Math.Pow(1 + (x * x) / n, -(n + 1.0) / 2.0)
    ChartSeries1.Points.Add(x, y)
Next

'Add the fully populated series to the chart
lineChart.Series.Add(ChartSeries1)

Output:

perform statistical utility functions


Conclusion

I hope you enjoyed learning about how to perform statistical utility functions using WinForms Chart.

You can refer to our WinForms Chart feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started with configuration specifications. You can also explore our WinForms Chart examples to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion®, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you! 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied