-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make charts interactive #18
Comments
…onjunction with dc.DrawRectangle, 1 needs to be subtracted. This is because rect.x + rect.width != rect.right (in fact it equals rect.right + 1) A better fix for #18.
I see that you have changed the mousevents handling in the code. Do you have a code example to enable tooltips? I would like to give it a go with changing the points on the plot using the mouse. |
I had a very simple version working, but it is disable for now due to the change in the dataset structure. Look at the bottom of axisplot.cpp and you will see the code I had in before. You simply need to override My code did a brute force search of all datasets to see if any datapoint is near the mouse cursor. As soon as it found one that was within a threshold, the handler called |
Following your old method, i adapted it to work with the new dataset. Here is the new code :
It seems to work quite nice, but it seems that there is an "offset" on the points that the tooltips are displayed. Maybe it is that the +5, -5 values are too high? I will do some more tests and report back. Also the when moving the mouse around the tooltip flickers. Maybe it has to do with the wxMemoryDC or something. |
Working a little bit more on the "interactivity" here is a code snippet that i use to drag points.
I hope that this will help enough to properly implement a "dragging" feature. |
Hi, I think that this is okay, but it would be better to somehow capture the point once dragging has started otherwise if you drag the point near another point it may jump and start dragging the other point instead. Also, this would avoid searching all the datasets on every mouse move. Therefore, I would suggest using both |
There has been some work on making charts interactive, but this needs to be completed.
The minimum requirement is to show a tooltip with the precise values when the user hovers the mouse over a specific data point.
The text was updated successfully, but these errors were encountered: