How to get C# to obtain relative value on Y-axis from point on X-axis?
-
I have created a line chart based of user input in C#. I would like to use a point on the X-axis based of user input, that would then intersect my line chart and obtain the relative point on the Y-axis. I would like to show this on the line chart through a vertical line extending from the X-axis point to the plot, and then a horizontal line from the plot to the Y-axis point. Thank you for any help.
-
I have created a line chart based of user input in C#. I would like to use a point on the X-axis based of user input, that would then intersect my line chart and obtain the relative point on the Y-axis. I would like to show this on the line chart through a vertical line extending from the X-axis point to the plot, and then a horizontal line from the plot to the Y-axis point. Thank you for any help.
That depends on how you graphed this and what library you used. A graph is just an output display. Chances are really good you're not going to be able to get data back from the graph at any arbitrary point you want. You're going to have to use your existing data and calculate that point yourself. Depending on the graphing library, you can then add this new line to the graph. We can't tell you how to do that because we know nothing about your code, data, graph type, library you used, ... nothing.
Asking questions is a skill CodeProject Forum Guidelines Google: C# How to debug code Seriously, go read these articles.
Dave Kreskowiak -
I have created a line chart based of user input in C#. I would like to use a point on the X-axis based of user input, that would then intersect my line chart and obtain the relative point on the Y-axis. I would like to show this on the line chart through a vertical line extending from the X-axis point to the plot, and then a horizontal line from the plot to the Y-axis point. Thank you for any help.
If you Google "cross-hairs" and C#, you can get some more ideas. [winforms - how to make the cursor lines to follow the mouse in charts using C# - Stack Overflow](https://stackoverflow.com/questions/8440894/how-to-make-the-cursor-lines-to-follow-the-mouse-in-charts-using-c-sharp)
"(I) am amazed to see myself here rather than there ... now rather than then". ― Blaise Pascal