We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
backgroundColor should support string and string[] in: Chart.defaults.backgroundColor
backgroundColor
Chart.defaults.backgroundColor
Using TypeScript, I'm getting this error when using an array of colors for backgroundColor:
Chart.defaults.backgroundColor = ['red', 'blue']; TS2322: Type 'string[]' is not assignable to type 'Scriptable<Color, ScriptableContext>'.
Chart.defaults.backgroundColor = ['red', 'blue'];
All Chart.js examples use arrays of colors, this should be supported.
A similar thing has been logged here as an improvement: #10123, but I think it's a bug.
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUG2pjFQCYCmedAFcANjDpUARujIBrAOaEhAOx7III6HAC8cANokAxHjwAGc6ZIAaUofMnzJALot2rAG6Y4ZGAA8dcDwQZEIgfMrc8nwwAKIifGERAEIAngCSPAAUAEQgKZyw2QCUcOh0cAASACoAsgAyyOjKnnRxCeEwrp5QcHkF8LrKfADuKJQwmT6+NghscPNwMClgfABcpGDAfNZzCzzoMOjrs6wLZ3Ai6JJ8InTretkASnw82TbZSSJCfG9w2QCaN00w1+2QA4lA+OFQQAFIRQMDxUEAeSgTSi2ScVl250CBzK0Tu+hOuNxl2uInWRjgEDwcAAahAYHwGNjTqSzvtDvcAIwAJhsPIAnDYAMw2ACsNgFcFFWJx52wTgV2DZZwgYBgwAgyiJJPOdDI6HieoVZ18xzN5yt81VNrgKUt7I59uwVrdzpwbGwRVcbCAA
No response
4.4.4
Chrome: 129.0.6668.70 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Expected behavior
backgroundColor
should support string and string[] in:Chart.defaults.backgroundColor
Current behavior
Using TypeScript, I'm getting this error when using an array of colors for
backgroundColor
:Chart.defaults.backgroundColor = ['red', 'blue'];
TS2322: Type 'string[]' is not assignable to type 'Scriptable<Color, ScriptableContext>'.
All Chart.js examples use arrays of colors, this should be supported.
A similar thing has been logged here as an improvement: #10123, but I think it's a bug.
Reproducible sample
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBAbzgYQBYENZwL5wGZQQhwDkAxhrAHQBWAziQNwCwAUG2pjFQCYCmedAFcANjDpUARujIBrAOaEhAOx7III6HAC8cANokAxHjwAGc6ZIAaUofMnzJALot2rAG6Y4ZGAA8dcDwQZEIgfMrc8nwwAKIifGERAEIAngCSPAAUAEQgKZyw2QCUcOh0cAASACoAsgAyyOjKnnRxCeEwrp5QcHkF8LrKfADuKJQwmT6+NghscPNwMClgfABcpGDAfNZzCzzoMOjrs6wLZ3Ai6JJ8InTretkASnw82TbZSSJCfG9w2QCaN00w1+2QA4lA+OFQQAFIRQMDxUEAeSgTSi2ScVl250CBzK0Tu+hOuNxl2uInWRjgEDwcAAahAYHwGNjTqSzvtDvcAIwAJhsPIAnDYAMw2ACsNgFcFFWJx52wTgV2DZZwgYBgwAgyiJJPOdDI6HieoVZ18xzN5yt81VNrgKUt7I59uwVrdzpwbGwRVcbCAA
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
4.4.4
Browser name and version
Chrome: 129.0.6668.70 (Official Build) (64-bit)
Link to your project
No response
The text was updated successfully, but these errors were encountered: