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?
Hey Graham.
Thanks for taking the time to help me out. I tried to calculate the ranges myself but couldn't get it to work quite right. I can't get the datapoint to stay under the mouse.
Do you think you can provide a small, sample app demonstrating how one might do this?
Thank you.
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.