You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Changes to resize events and animation in 4.5.1 #12143
As a result of #12097, using Chart.js with a fractional width or height (due to specific HTML layouts, a fractional zoom, etc.) may trigger extra resize and update events on render. This is a potential behavior change and performance regression, and it has a more noticeable visual effect: the animation on initial render is lost due to the extra re-renders.
Hi @joshkel
I face an issue after updating from 4.5.0 to 4.5.1 and it's only a problem with zoom levels different than 100% so I believe it's related to the issue you reported.
The extra resize triggers re-renders, which crashes my app when using chartjs-plugin-datalabels.
hook.js:608 React Router caught the following error during render TypeError: Cannot read properties of undefined (reading 'length')
at Object.draw (chartjs-plugin-datalabels.esm.js:1003:31)
at Object.afterDatasetsDraw (chartjs-plugin-datalabels.esm.js:1302:12)
at callback (helpers.core.ts:109:15)
at PluginService._notify (core.plugins.js:65:11)
at PluginService.notify (core.plugins.js:46:25)
at Chart.notifyPlugins (core.controller.js:1130:26)
at Chart._drawDatasets (core.controller.js:775:10)
at Chart.draw (core.controller.js:724:10)
at Chart.render (core.controller.js:693:12)
at Chart._resize (core.controller.js:299:14)
For the unknown reasons, _labels is undefined (only with zoom != 100%).
Activity
kk-adi commentedon Oct 31, 2025
Hi @joshkel
I face an issue after updating from 4.5.0 to 4.5.1 and it's only a problem with zoom levels different than 100% so I believe it's related to the issue you reported.
The extra resize triggers re-renders, which crashes my app when using
chartjs-plugin-datalabels.For the unknown reasons,
_labelsis undefined (only with zoom != 100%).joshkel commentedon Oct 31, 2025
@kk-adi Thanks for the info. If you're able to test #12142, to see if that fixes it, that may be helpful. Or, if you're able to share a reproducible example at https://codepen.io/leelenaleee/pen/WNyJXEe or similar, I can test it out.
fix: aspectRatio未変更時はresize()をスキップしてアニメーションを維持
fix: Chart.js 4.5.1のresizeリグレッションを回避するため4.4.7に固定
Pin chartkick < 5.2.1 to avoid Chart.js 4.5.1 animation regression (#203
fix: Chart.js 4.5.1のresizeリグレッションを回避するため4.4.7に固定