Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio
  4. How to get C# to obtain relative value on Y-axis from point on X-axis?

How to get C# to obtain relative value on Y-axis from point on X-axis?

Scheduled Pinned Locked Moved Visual Studio
csharphelptutorialquestion
3 Posts 3 Posters 15 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Member_14192597
    wrote on last edited by
    #1

    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.

    D L 2 Replies Last reply
    0
    • M Member_14192597

      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.

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • M Member_14192597

        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.

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups