06-20-2014 09:23 AM
Hello,
I've been using the measurement graph object in Form and now I need to reuse some functions in WPF. Some of them was dealing with hit test because they need to know the current coordinate clicked by the user, not the screen coordinate, but the position in the plan related to the current x and y scaling.
The best approach I could find was to compute a x & y ratio using GetPlotAreaPosition(e) and GetPlotAreaSize() but this works only when the plot is not Zoomed nor panned. I was unable to find the properties related to zoom and pan to correct my ratio calculation.
Any help would be appreciated, Best regards,
Solved! Go to Solution.
06-20-2014 11:15 AM
You can get the relative (ratio) value for the screen point returned by GetPlotAreaPosition
using the ScreenToRelative
method, but this is independent of the scale configuration.
To get the interpolated data point under the mouse, you can use the RelativeToData
method instead. Or if you want to get the closest plot data value, you can use the FindNearestValue
method.
06-23-2014 02:26 AM
Thank you so much, that's exactly what I was looking for.