chartjs / chartjs/Chart.js

chart.update('none') while animations are in progress is lost

Open
#11,957 0 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
JavaScript
Stars
67.7k
Forks
11.9k
Avg merge
7h 39m
Merged PRs (30d)
5

Description

### Expected behavior

When update('none') is called, already running animations are updated with new values - or the animations are aborted (bad, but at least the result is correct)

### Current behavior

While fixing issues in zoom plugin, noticed that if there is an animation (zoom) ongoing and during that zoom user pans the chart =update('none'), points (in this case it was a scatter chart) end up in the wrong places. Panning again fixes the chart.

What happes is:
- animations are running, having for example some target coordinates for the points
- update none updates the points directly with correct values
- next frame, the animations override those directly updated values with the next step in animation - the update is lost

image

### Reproducible sample

https://codepen.io/kurkle/pen/NWQVbyB

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

v4.4.6

### Browser name and version

_No response_

### Link to your project

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.