-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
All chart examples are decreasing in size when pixelRatio is non-terminating value #11224
Comments
Anyone played with this to find any hotfix possible? |
I've successfully reproduced this issue with Pixel 6a and the official samples. It seems that some non-default system-wide zoom triggers it, because I can't reproduce it on secondary profile with default system-wide zoom. Is there any workaround? |
I've investigated this a bit:
|
Key conditions for triggering the bugAside of a specific devicePixelRatio (and probably responsive: true), it seems that it also depends on the container height:
The same probably applies to width, except that block objects usually take all the available width, which prevents this issue from being caused by width. WorkaroundJust set height of the container. If you hesitate:
So far, the workaround looks OK. |
Hi, how i fixed chart in my react app:
After:
|
We were having a similar issue where opening or closing Chrome's dev console was causing the graph to visually break. We were able to resolve it by removing this line from
Related threads for convenience:
|
Calling |
Expected behavior
When triggering some hover event in a chart, the expected behavior is just to keep the real size.
Current behavior
The charts are shrinking in size, similar to what was reported in #10951.
Reproducible sample
https://www.chartjs.org/docs/latest/samples/area/line-boundaries.html
Optional extra steps/info to reproduce
302.0639419555664
to Zoom extension2023-04-07.02-24-36.mp4
Possible solution
Limiting the value of pixelRatio to discrete values.
Context
On my Xperia 1 II running Chrome, I have noticed that whenever I visit a website that utilizes Chart.js, the charts are consistently shrinking in size. Upon setting "Brake on > attribute modifications" in the Chrome developer tools on the shrinking canvas element, I observed that the values stored in the variables within the retinaScale function are gradually decreasing.
Initially, I suspected a bug in the heatmap graph on Misskey, a recently popular distributed social networking service in Japan. However, I realized that the service was using Chart.js v4.2.1 (after #10971 was merged), which leads me to suspect that the issue lies with Chart.js itself.
chart.js version
v4.2.1
Browser name and version
Google Chrome 111.0.5563.147(Official Build)
Link to your project
No response
The text was updated successfully, but these errors were encountered: