chartjs / chartjs/Chart.js

Colors of points in line chart doesn't update when chart.update("none") is set

Open
#11,507 12 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

I wrote a function that changes the colors of every dataset in the chart when a button is pressed. When pressed i would expect the color of the line, line fill, point and point fill to change with no animation because chart.update("none") is set.

_How i expect the chart to look after color change (original color is black)_
![billede](https://github.com/chartjs/Chart.js/assets/38009346/6587e66a-2e96-4234-9715-440311fd3a0b)

### Current behavior

When i press the button the color of the line and line fill changes like it should, but the color of the point and point fill doesn't change. However when i hover over a point it shows the correct color and when i hide a dataset, the entire chart updates and all colors are then correct.

This only happens when chart.update("none") is set and not when just using chart.update().

Whether i use borderColor and backgroundColor or pointBorderColor and pointBackgroundColor the behaviour is the same

_How the chart actually looks after color change (original color is black)_
![billede](https://github.com/chartjs/Chart.js/assets/38009346/48134f8a-fc91-4b05-8dd1-6535f4f00ef1)

### Reproducible sample

https://codepen.io/AsgMog/pen/zYyRWzz

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

I'm trying to create a button that changes the color of the chart without the change being animated.

### chart.js version

v4.4.0

### Browser name and version

Firefox 115.2.1esr

### 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.