Skip to content
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

Chart.Events.getNearestX does not work properly when the chart overflows it's container #92

Open
oyshol opened this issue Sep 20, 2021 · 1 comment

Comments

@oyshol
Copy link

oyshol commented Sep 20, 2021

Chart.Events.getNearestX (and Chart.Events.getNearest) seems to assume that the chart (with margins taken into account) start at the same coordinates as it's container. This becomes a problem if you let the chart overflow the container and then scroll in order to see the rest of the chart. As demostrated in this ellie example https://ellie-app.com/fjWqwCtT3PLa1, after scrolling to the right, the getNearestX function is no longer able to find the nearest point reliably.

By decreasing the size of the chart as the screen/window gets narrower, details in chart get less clear and the axis labels become hard to read. On the other hand, tooltips and legends keep their original size on narrow screens and do not match the shrunken chart. The use of overflow preserv the original sizes.

It seems like the assumption stems from the Internal.Svg.decoder function, but I'm not sure how to change it.

@terezka
Copy link
Owner

terezka commented Oct 26, 2021

I'm not sure how to fix this yet! One way around it is to add the overflow-x prop closer to the chart like in this ellie. I'll think about it and get back with I fix once I find one! In the meantime, thank you for your patience. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants