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
490
Using the mouse to move datapoints
posted

Hey guys,

I was working off an example I found on these forums to allow users to interact with the chart using the mouse.  I capture the usual mouse events and as the mouse moves, I update the datapoint's value (I'm using a 2D line chart).

However, there is a problem I am running into.  As I drag a value, the y-axis value might change (sinve the y-axis has AutoRange set to true).  The problem is when the range of the y-axis changes, the datapoint appears in  a different position on the screen, and is no longer under the mouse. It is easy to see this.  Just slowly drag a datapoint.  It will be under the mouse until the range of the y-axis is changed.  Then the datapoint is "moved" and the next mouse move causes it to jump ahead.  This causes erratic movements when using the mouse to change a value.

Is there a way to have the datapoints move smoothly along with the mouse when AutoRange is set to true?

Parents
No Data
Reply
  • 30692
    Suggested Answer
    Offline posted

    Maybe you should try disabling the autorange during the drag? Or do you need the range to adjust while someone is moving the point? You may need to take control over calculating the ranges manually and then you can make sure the point stays under the mouse during the range change.

Children