Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shifting items of array option for dataset breaks the chart #9095

Closed
nagix opened this issue May 14, 2021 · 1 comment · Fixed by #9101
Closed

Shifting items of array option for dataset breaks the chart #9095

nagix opened this issue May 14, 2021 · 1 comment · Fixed by #9101
Milestone

Comments

@nagix
Copy link
Contributor

nagix commented May 14, 2021

Expected Behavior

I created a line chart, and a dataset has a backgroundColor array. When the first items of the data and backgroundColor arrays are removed using shift(), it should be correctly reflected in the chart.

Current Behavior

When the first items of the data and backgroundColor arrays are removed, elements in the chart have wrong colors.

Screen Shot 2021-05-15 at 12 22 33 AM

Possible Solution

Not sure, but I suspect that the caching when resolving the options might cause the problem.

Steps to Reproduce

Press 'Push Data' button, then press 'Shift Data' button.

https://jsfiddle.net/nagix/6n34bsym/

Environment

  • Chart.js version: 3.2.1
@kurkle
Copy link
Member

kurkle commented May 14, 2021

Its the cached $context that holds the old intex:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants