Trackball display issue

4 posts, 0 answers
  1. Avneesh
    Avneesh avatar
    13 posts
    Member since:
    Jul 2013

    Posted 06 Nov 2013 Link to this post

    I wanted my trackerball data display to be next to the mouse cursor rather than displaying at top of the tracker line. I did this by using trackBall.Margin = new Thickness(left, top, 0, 0); on mouse move of the chart. This works fine until the line starts to move towards the Y axis on either side.. Then the margin is not taken into account and it looks as if it leaves the space according to the width of the tracker data displayed. So if I have displayed long names in tracker template - then the width is more when it starts to ignore the margin from bit far off from Y axis. Can someone please help me to resolve this issue.


  2. Petar Marchev
    Petar Marchev avatar
    968 posts

    Posted 11 Nov 2013 Link to this post

    Hello Avneesh,

    I suggest that for testing purposes you turn off this custom code that sets the Margin of the track ball. Then when the track ball reaches the end of the plot area you will see that it is not centered in consideration to the track line, but instead it is moved fully inside the plot area. This is done so that the track ball does not get clipped and does not overflow the chart space.

    You need to take this in mind when you build your Margin work-around. You can get where the track ball will be positioned from the Canvas.Left and Canvas.Top values from the TrackBallInfoControl.

    Petar Marchev
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dev
    Dev avatar
    6 posts
    Member since:
    Feb 2009

    Posted 26 Feb 2014 Link to this post

    How can we change trackball info display location to avoid overlapping with graph line?
    I am not using annotation in my project.  Sample code snippet would be really helpful.

  5. Petar Marchev
    Petar Marchev avatar
    968 posts

    Posted 03 Mar 2014 Link to this post

    Hello Dev,

    You can attach a handler to the MouseMove event and set an appropriate Margin (top) to the track info control. I have attached a simple project for demonstration.

    Petar Marchev
Back to Top