chartjs / chartjs/Chart.js

Rendering issue for Background color (Gradient and Opacity for solid color)

Open
#11,310 15 comments 2 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

We are expecting Charts (Line Charts) with a solid background color that doesn't blink when getting filled out by the color

Example of expected look inside our views (we were expecting a gradient, but we switch it to a solid color)
Screenshot 2023-05-25 at 12 53 31 p m

### Current behavior

Using the next configuration for our dataSets:

`const datasets = [
{
label: 'Total',
data: subtotalAmountData,
fontColor: '#6B7280',
pointBackgroundColor: '#1C64F2',
pointBorderColor: '#1C64F2',
fill: 'start',
pointRadius: 3,
backgroundColor: 'rgba(28, 100, 242, 0.5)',
borderColor: 'rgba(28, 100, 242)',
},
];`

We are seeing that our charts are looking with a little lag in the rendering, last for a second, and once the user scroll or clicks on it is gone

Screenshot 2023-05-25 at 12 55 23 p m
Screenshot 2023-05-25 at 12 55 19 p m
Screenshot 2023-05-25 at 12 53 31 p m

### Reproducible sample

https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUGwG6ZxkwAecALxwAJhDIBXEAFMAdjCoBzaTACiAG2kz5AIQCeASREAKAEQg9aTDFMBKOOjpwAEgBUAsgBlk6WVzoaWnIwLKxcUHAWVljCstIA7iiUMMa8fAA0iGxwOXAwemDSAFyk6sBxJOnZuSLoMOglCNW5ueroAEbS6nQlANqmAErSIqaZpjrqEtKjcKYAml3qEPEzpgDiUNJyqwAKElBgmqsA8lC+yqYAulWsLS219XQqPXC9Tbd3n22d6iUkAMRwCB4OAANQgMGkDBun0+DwarwAjAAmTKIgCcmQAzJkAKyZVFwLHXZp3bCXUnYGG5CBgGDACCyF7vT50MjoTTM0ktPiNbl3fk5KmCuB6PkfWFwEXYfkyiU4NjYWyMIAa

### Optional extra steps/info to reproduce

_No response_

### Possible solution

_No response_

### Context

_No response_

### chart.js version

^5.2.0

### Browser name and version

react-chartjs-2

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