Closed FarawayFowl closed 8 months ago
Can I pick this?
When you want to set default colors you will need to dissable the colors plugin. This is beacause if we are going to check if the defaults have a value too the plugin will always be deactivated since the defaults are already filled by chart.js itself with basic values.
You can dissable the plugin with the defaults using this line: Chart.defaults.plugins.colors = false;
Or you can disable it on a per chart bases using this config:
options: {
plugins: {
colors: false
}
}
Thank you for this! As far as I can see, this behaviour is not documented yet. Perhaps it could be documented here:
https://www.chartjs.org/docs/latest/general/colors.html#default-color-palette
Expected behavior
Chart.defaults.borderColor
andChart.defaults.elements.line.borderColor
should manipulate the default color of a dataset in a line chart.Current behavior
The default color of a dataset in a line chart stays blue, regardless what was previously defined.
Reproducible sample
https://codepen.io/FarawayFowl/pen/JjzNeRz
Optional extra steps/info to reproduce
No response
Possible solution
No response
Context
No response
chart.js version
4.4.1
Browser name and version
Microsoft Edge for Business | Version 120.0.2210.133 (Offizielles Build) (64-Bit)
Link to your project
No response