Bober02 Posted July 29, 2010 Report Share Posted July 29, 2010 Hey all, I am trying to get a value from xAxis by checking (somehow) current pixel value of the mouse position e.g. by using hitTest. It works ok for decimal values on X axis, but what if I have dates? I get back double value of e.g. 62089563 for a date... how can I actually use chartFX to get value from XAxis (actual DateTime object) from pixel position (or a similar technique) ? Quote Link to comment Share on other sites More sharing options...
JuanC Posted July 29, 2010 Report Share Posted July 29, 2010 If you are using PixelToValue note that we return a DataUnit which have intrinsic castings to dates so you can write the following DateTime d = chart1.AxisY.PixelToValue(300);If you are using other API that returns a double you can use the following code DateTime d2 = DataUnit.DoubleToDate(500);Also note that most of our data-related properties are DataUnit so you can pass a DateTime directly to AxisY.Min/Max etc. JuanC 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.