-
Notifications
You must be signed in to change notification settings - Fork 12k
Open
Labels
Description
Documentation Is:
- Missing or needed?
- Confusing
- Not sure?
Please Explain in Detail...
When I change the size of my chart animation and reload the page, the animation sometimes doesn’t work. I tested different sizes and found that it only works reliably when the size is a multiple of 4. After hours of investigation, I realized this happens because my devicePixelRatio (DPR) is 1.25.
With a fractional DPR, Chart.js calculates the chart radius as a non-integer. When the canvas tries to draw the animation, the browser rounds the size, which triggers a resize internally. As a result, the animation does not play.
I think this behavior should be mentioned in the Chart.js documentation, as it can be confusing for developers.
Your Proposal for Changes
Write about this behaviour in documentation
Example
No response