Skip to content

Changes to resize events and animation in 4.5.1 #12143

@joshkel

Description

@joshkel

Expected behavior

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.

Current behavior

See above.

Reproducible sample

https://codepen.io/joshkel/pen/azdjLGZ

Optional extra steps/info to reproduce

Compare the initial render animation and the browser's console log output between 4.5.0 and 4.5.1.

Possible solution

No response

Context

See #12097 (comment) for discussion.

chart.js version

4.5.1

Browser name and version

No response

Link to your project

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions