0

I'm using Microsoft visual studio 2010, wpf, Dynamic Data Display, ChartPlotter (map) that I should take the point on the map exactly, the horizental is working perfect, but the vertical is inaccurate, its give wrong position.

code :

   private void MouseMove(object sender, MouseEventArgs e)
        {
            Point pt = e.GetPosition(this.plotter.CentralGrid);
            Point ps = this.plotter.Viewport.Transform.ScreenToViewport(pt);

            lbl_X.Content = ps.X.ToString();
            lbl_Y.Content = ps.Y.ToString();
        }

the lbl_Y.Content is inaccurate. the function is MouseMove on the plotter. Thanks for help. good day :)

Ben Tubul
  • 45
  • 1
  • 9

1 Answers1

0

Never mind i found the answer, if anyone need:

Point pt = e.GetPosition(this.plotter.CentralGrid);
Point ps = this.plotter.Viewport.Transform.ScreenToViewport(pt);

lbl_X.Content = ps.X.ToString();
lbl_Y.Content = this.plotter.Viewport.Transform.DataTransform.ViewportToData(ps).Y.ToString();
Ben Tubul
  • 45
  • 1
  • 9