-
Notifications
You must be signed in to change notification settings - Fork 12k
Closed
Labels
type: typesTypescript type changesTypescript type changes
Description
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
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
Metadata
Metadata
Assignees
Labels
type: typesTypescript type changesTypescript type changes