Click here to Skip to main content
15,894,720 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to plot a graph which displays x axis and y axis values in wpf which should display with in canvas


What I have tried:

how to plot a graph which displays x axis and y axis values in wpf which should display with in canvas
Posted
Updated 25-Apr-19 6:51am
Comments
Christian Graus 23-Apr-19 3:06am    
Write code. Your vague question indicates you've not tried

1 solution

* Every WPF element that you can add to your XAML, is a class that you can instantiate in C# and add it to a container (in your case the Canvas). So, you can use this link as a reference Shapes How-to Topics | Microsoft Docs[^] and then write C# code to generate the elements you want and add them to the canvas.

* Canvas reference point (0,0), like most other graphical surfaces, is at top left. If you want to have your reference point on bottom left, like many other charts, you can either do the math internally or use WPF transformations to do the corrections. I might be wrong, but I guess if you apply a Scale Transform of -1 over Y axis, you can mirror your canvas.

[I love Christian Graus's comment BTW! :D]
 
Share this answer
 

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