-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Wrong ScatterPlot points positions when useViewBoxResizing with useCanvas #1596
Comments
Hi @JonathanJDubois, thanks for the report! I'm not a big fan of However, the feature definitely won't work with If your chart divs are pinned to the right size, the resize can be as simple as chart
.width(null)
.height(null)
.rescale()
.redraw(); Detecting the resize is more difficult than it should be. The ResizeObserver API only landed recently, and although caniuse.com reports support across the three major browsers, it still didn't work for me in Safari. In any case, I added canvas support to the resizing scatter example. This relies on the old and universal window resize event. It uses And I created a new resizing scatter plot with ResizeObserver example. The code is much nicer: it uses flexbox to determine the sizes, and can automatically determine the width and height as shown above. Both examples disable animated transitions, because I also found that the canvas element was not getting resized, so I fixed that in version 3.1.6. |
Hi thanks for your quick answer and for the fixes. |
Hi thanks to add the canvas backend rendering rendering it will help us a lot.
I have a small issue when I use the canvas rendering backend with the useViewBoxResizing options enabled.
It seems the canvas no longer fit to the svg item.
How to reproduce the problem:
=> The charts is correctly scaled but the canvas is not correctly displayed
The text was updated successfully, but these errors were encountered: