Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
30
Need help in WPF Chart control to map Mouse Coordinates to Y Axis
posted

I would appreciate if someone could point me how to map mouseCoordinates to Y Axis. I know For Ultrachart there is a call AxisY.MapInverse() but for WPF control i could not find it.

 

I am trying to implement drag and drop of scatter points by MouseDown/ MouseMove/ MouseUp and using Chart.HitTest(e). Most of the code works. Just on MouseUp i need to know the new coordinates in Y Axis.

 

thanks

Atul

Parents
  • 17605
    Verified Answer
    posted

    You don't need to use MapInverse(), you have the coordinates mapped to the axes.

    private void XamChart_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)

    {

    HitTestArgs args = Chart.HitTest(e);

    double yAxisValue = args.YValue;

    double xAxisValue = args.XValue;

    }

Reply Children
No Data