Chart.js icon indicating copy to clipboard operation
Chart.js copied to clipboard

Resposive chart infinitely shrinking with certain zoom levels

Open CamBurris opened this issue 2 years ago • 7 comments

Expected behavior

Responsive chart should be a stable size with all devicePixelRatios.

Current behavior

Chart will infinitely shrink when certain devicePixelRatios are used.

Behavior occurs with a devicePixelRatio of 1.3499999046325684.

The ratio can be achieved naturally by users:

Windows 10 Screen resolution: 1920x1080 Windows resolution scaling: 150% Chrome zoom level: 90%

Reproducible sample

https://codesandbox.io/p/sandbox/chartjs-responsive-zoom-thccwr

Optional extra steps/info to reproduce

Demo uses css zoom property. Need to use a browser that supports zoom, such as Chrome.

Possible solution

No response

Context

I believe this is the same issue as https://github.com/chartjs/Chart.js/issues/10890.

Either the issue was reintroduced or the original fix didn't work for all scenarios.

chart.js version

4.4.1

Browser name and version

Chrome 119

Link to your project

No response

CamBurris avatar Dec 11 '23 17:12 CamBurris

Same here with 3840x2160 screen, it happen in Edge, Chrome and Brave. But curiosly enough, not in Firefox. It will happen with both 90% and 110% zoom.

PabloMartinez-Beemeral avatar Jan 08 '24 10:01 PabloMartinez-Beemeral

Encountered this issue with following versions:

    "chart.js": "4.4.1",
    "chartjs-plugin-annotation": "3.0.1",

abm0 avatar Mar 21 '24 14:03 abm0

hello, I encountered this issue in chart.js v 4.4.3 also, is there any solution or workaround?

MernaAyman avatar Aug 01 '24 23:08 MernaAyman