Click here to Skip to main content
15,888,803 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I need it in a windows form application to plot graph of inequalities given any equation. Thanks. I just need the idea and logic to do it.
Posted
Comments
ZurdoDev 27-Aug-14 8:38am    
I believe there is a chart control for winforms.
matmape 27-Aug-14 8:42am    
okay, can I use it to draw lines?
Maybe I should read more on the Graphics Class with the DrawLines() method
Sid_Joshi 27-Aug-14 8:54am    
If U wants to draw Charts use System.Windows.Forms.DataVisualization.Charting Reference.

Please don't try to use Solution 1; in almost all cases, it won't work; anyway, it does not give you a right idea on how to make it working.

Please see my past answers:
What kind of playful method is Paint? (DataGridViewImageCell.Paint(...))[^],
capture the drawing on a panel[^],
How to speed up my vb.net application?[^],
Zoom image in C# .net mouse wheel[^],
Drawing Lines between mdi child forms[^].

Besides, you can use Microsoft Charts:
http://msdn.microsoft.com/en-us/library/system.windows.forms.datavisualization.charting.chart%28v=vs.110%29.aspx[^] (for .NET v.4.0-4.5).

For .NET 3.5, you can download Microsoft Chart Controls for Microsoft .NET Framework 3.5:
http://www.microsoft.com/en-us/download/details.aspx?id=14422[^].

—SA
 
Share this answer
 
Comments
matmape 27-Aug-14 12:15pm    
okay thanks SA, I will check those links
Pikoh 3-Sep-14 11:04am    
Let's give this answer a five,to compensate the 1 some spiteful has given to you :)
Sergey Alexandrovich Kryukov 3-Sep-14 11:34am    
Thank you very much. It happens on a regular basis: a serious of down-votes in quick succession, very likely without even reading the answers. I call it "emotional voting". Hatred voting, revenge, I don't know... :-)
—SA
Graphics gdi = this.CreateGraphics();
            gdi.DrawLine(Pens.Red, new Point(0, 0), new Point(100, 100));
 
Share this answer
 
v2
Comments
matmape 27-Aug-14 8:53am    
Thanks for that, would implement this too
Sid_Joshi 27-Aug-14 8:55am    
If U wants to draw Charts use System.Windows.Forms.DataVisualization.Charting Reference.
matmape 27-Aug-14 11:58am    
I didnt mean chart, what I want to use it for is to create textbox to enter the inequality equation and then generate a graph representing the solved inequality. Ive learnt how to draw line but, the logic behind solving the problem is somehow difficult for me
Sergey Alexandrovich Kryukov 27-Aug-14 11:52am    
Very bad answer. It depends on the context, but normally such lines will disappear at any invalidation. The instance of Graphics should be the one passed to OnPaint of the handler of Paint.
—SA
matmape 27-Aug-14 11:57am    
but, I think i can fire it up using a button and not necessarily the Form's paint handler

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