Click here to Skip to main content
15,878,748 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I would like to create line chart for more than 2 points in c#.net windows application. Can anyone help
Posted

The Zedgraph is a very good charting library for drawing charts in Windows application. It is explained here in this Code Project article
A flexible charting library for .NET[^] by JChampion with several examples.

I think it may be helpful.
 
Share this answer
 
Take the top coefficients from the website I linked to:

C#
// For np = 5 = 5 data points
var h = 35.0;
var coeff = new float[] { 17, 12, -3 }; // coefficients from the site
var easyCoeff = new float[] {-3, 12, 17, 12, -3}; // Its symmetrical
var center = 2; // = the center of the easyCoeff array
// now for every point from your data you calculate a smoothed point:

smoothed[x] = 
   ((data[x - 2] * easyCoeff[center - 2]) +
    (data[x - 1] * easyCoeff[center - 1]) +
    (data[x - 0] * easyCoeff[center - 0]) +
    (data[x + 1] * easyCoeff[center + 1]) +
    (data[x + 2] * easyCoeff[center + 2])) / h;

The first 2 and last 2 points you cannoth smooth when using 5 points.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900