terezka / elm-charts

Create SVG charts in Elm.
https://www.elm-charts.org
BSD 3-Clause "New" or "Revised" License
711 stars 67 forks source link

onHover with overlapping plots #55

Closed chancyk closed 7 years ago

chancyk commented 7 years ago

With the new API you seem to be forced to overlap plots if you want to render multiple data series on the same axes, for instance:

image

This works okay except the onHover of PlotCustomizations seems to only trigger on the top-most plot, which I'd think would not be a limitation of the DOM unless stopPropagation was being used, but seems to be what I'm experiencing.

chancyk commented 7 years ago

It seems like this actually is just an issue with how mousemove behaves with overlapping divs, as seen here: https://jsfiddle.net/s9ha5b5b/

pointer-events: none can be used to pass events through to a lower element, but there does not seem to be a simple way to trigger the event on all overlapping elements.

terezka commented 7 years ago

Hi! Thanks for writing! You can add two series in one plot though. Here's an example. Is there some condition causing this not to work?

P.S. Sorry for the late answer!

chancyk commented 7 years ago

I think that's going to work for me. I missed that I could just wrap my different series in a record to differentiate them in toDataPoints. ^ ^;

Thanks for your help! I'll close out this issue.