How to plot XY graph in C#?

8.6k views Asked by At

I am developing an application in C# which deals with specific genetic algorithm problem. The execution of the algorithm provides output parameters that are required to draw a chart.The graphic chart consists of 2 independent axis, lets say X is number of generation and Y represents corresponding maximum value of fitness function. To be more specific, I've uploaded picture from Excel so here it is :

http://img97.imageshack.us/img97/2046/graphnb.png

My priority is to make this application fully-functional by allowing user (who sets random execution factors such as mutation percentage, population and generation number, number of elite individuals, etc.) to see generated X-Y graph inside the generated "Form" in C#. I've found site that partially solves my problem, but that's not the whole point (http://csharp.net-informations.com/excel/csharp-excel-chart-picturebox.htm). So I'm asking if there is a way to implement mentioned graph by not using any other applications, but maybe only C# libraries and functions for plotting or something like that? Hope I made myself clear. Best regards.

4

There are 4 answers

1
servermanfail On BEST ANSWER

Free and native answer is http://zedgraph.org/wiki/index.php?title=Main_Page

  • Does not involve WPF
  • Does not cost
  • Only C# libraries
  • Works inside a .NET WinForm
0
Ben M On

If you can use it, try WPF. It's much better for developing graphically rich user interfaces than standard Windows Forms -- especially if you don't want to use third-party libraries.

0
Davide Piras On

personally I like XtraChart of DeveloperExpress, but there are also many many other cheaper or more expensive alternatives, also other questions similar to yours here in SO: WPF chart controls

I like to use libraries whenever I can so I can focus on my real business case instead of trying to re-invent the wheel everytime, also because usually it's not trivial to reach the same level of results of people working hard to deliver specific components.

0
Saad Qureshi On

As all have said you have to work on WPF (different platform then WinForms) with 3rd party charting library that are much easier to integrate with your application. If you want to know further about charting library then you should see this page Click here