Bob Posted September 15, 2008 Report Share Posted September 15, 2008 Greetings, I have a line chart that has a stack of values plotted where the Y axis uses numeric values and the X axis is time ... I want my users to click anywhere on the graph and get the X axis value .. i.e. 10:45am ... I intend to use this value to comment on parts of my graph. By using the "MouseClick" event I can get the "value" property which is the opposite of what I want as it returns the Y axis value I want the X axis value . The dream being a user clicks on the graph .. and I pop up a dialog box for them to enter some text and I have the X value from the mouse click. How can I get my X axis value (and not the x and y pixel values which are useless) cheers. Quote Link to comment Share on other sites More sharing options...
Frank Posted September 15, 2008 Report Share Posted September 15, 2008 Use: double xValue = chart.AxisX.PixelToValue(e.X); Where e is the event args of the MouseClick event. Quote Link to comment Share on other sites More sharing options...
Bob Posted September 15, 2008 Author Report Share Posted September 15, 2008 And for completness. double xValue = chart.AxisX.PixelToValue(e.X); DateTime dt = DateTime.FromOADate(xValue); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.