Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello friends,

In my project there are few values of x & y in an array & I want to draw a nonlinear best fit curve in c# so any one can help me how to add data to chart.

I want whole code for it. How to create data source or how to bind data to chart control. I have downloaded win-sample chart control but not getting how to add data to chart.

If you have any other idea please give me.

plz help me..... thanks
Posted
Updated 3-Apr-11 6:59am
v2

1 solution

As far as binding data to the chart is concerned, see How to add data in winsample chart control[^] from a similar previous question.

There is an article here on The Code Project for Bezier Curves Bezier Curves Made Simple[^], which may give you some ideas if nothing else.

A quick search has revealed several libraries that claim to implement non-linear curves. I can only suggest that you search for yourself and have a look at some of them.
 
Share this answer
 
Comments
Henry Minute 3-Apr-11 13:23pm    
What's not working!

How on earth does a statement like "it's not working" help us to help you?
Member 7685573 3-Apr-11 13:28pm    
I want to draw graph against date time
Member 7685573 3-Apr-11 13:34pm    
thanks very much u have given right code but i want similar code for data time chart is there any control to draw such graph
Henry Minute 3-Apr-11 13:38pm    
Have you looked at http://www.microsoft.com/downloads/en/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&displaylang=en

I can't remember how easy Date/times are in them but there is a samples page at http://archive.msdn.microsoft.com/mschart

Hope that helps.
Member 7685573 3-Apr-11 14:00pm    
i have use it but i don't know how to add data to these control at run time if u can tell me plz tell thanks for replay

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