colors
Configuration Structure
colors: {}colors
Colors for the chart's series. When all colors are used, it starts from the beginning.
Each entry is either a CSS color string or a function which receives the following parameters: value, seriesIndex, w (chart config).
A color string can be any CSS color: hex, a named color, rgb() or hsl() in comma or space syntax, oklch(), color-mix(), color(display-p3 ...), or var(--brand). From 8.8.0 space-syntax rgb(), color-mix() and color() no longer draw grey, and a custom property set on the chart's container rather than on :root works, including for the lighter and darker shades the chart derives from a series color.
colors: ['#2E93fA', '#66DA26', '#546E7A', '#E91E63', '#FF9800']
// or any CSS color (8.8.0)
colors: ['oklch(62% 0.19 255)', 'color-mix(in srgb, #2E93fA 60%, white)', 'var(--brand)']
// or with a function
colors: [function({ value, seriesIndex, w }) {
if (value < 55) {
return '#7E36AF'
} else if (value < 80) {
return '#164666'
} else {
return '#D9534F'
}
}]