HumbleSoftware / Flotr2

Graphs and Charts for Canvas in JavaScript.
http://www.humblesoftware.com/flotr2/
MIT License
2.45k stars 528 forks source link

Mouse track and hidden series #234

Closed ioguix closed 11 years ago

ioguix commented 11 years ago

Hello,

I use some mechanism to show/hide series on a graph in combination with the mouse tracker plugin. However, I noticed that even when a series is hidden, the mouse plugin keep hitting it.

Here is an example: http://jsfiddle.net/P85me/ "d2" is hidden, but when hovering the graph, you can still hit its values.

I wonder if the best way is to have an option to the mouse plugin to deactivate that or if it should be considered as a bug. Thoughts ?

Moreover, when trying to find a way to deal with it, I tried to observe for event 'flotr:hit', but it always highlight the value on the graph and show the tooltip. It seems there's no way to just catch the event and deal with it before. Shouldn't this display related things be handled in the mouse code instead ? At least, outside or after of the event fire ?

cesutherland commented 11 years ago

Hey, I pushed what should fix this! Let me know.

ioguix commented 11 years ago

Hello,

I hadn't time to successfully install an environment to build the flotr2.min.js yet. I'll try to answer as soon as I could make a test!

Thank you for the patch!

ioguix commented 11 years ago

Ok, I manage to install the dependencies to "make flotr2" and did some tests.

This fix seems to work as expected. But I'm afraid I found another bug while testing:

While lines are stacked, the mouse plugin hit on the real value of the series, which is not on drawn line.

See http://jsfiddle.net/pWqwc/

Do you want me to open a new issue about that or should we keep going on this one ?

cesutherland commented 11 years ago

136 is that issue, it's still open. Is that a feature you need currently?

ioguix commented 11 years ago

I think we can close this issue as the original subject is now fixed.

thank you!