[英]How to set custom color on stacked bar chart
You can enable colorByPoint
option for the last series:您可以为最后一个系列启用colorByPoint
选项:
series: [..., {
...,
colorByPoint: true
}]
Live demo: https://jsfiddle.net/BlackLabel/fdwbLzan/现场演示: https://jsfiddle.net/BlackLabel/fdwbLzan/
API Reference: https://api.highcharts.com/highcharts/series.column.colorByPoint API 参考: https://api.highcharts.com/highcharts/series.column.colorByPoint
or define an individual color for each point:或为每个点定义单独的颜色:
series: [..., {
...,
data: [{
y: 3,
color: 'black'
}, {
y: 4,
color: 'purple'
}, {
y: 4,
color: 'green'
}, {
y: 2,
color: 'orange'
}, {
y: 5,
color: 'blue'
}]
}]
Live demo: https://jsfiddle.net/BlackLabel/r87mv6n3/现场演示: https://jsfiddle.net/BlackLabel/r87mv6n3/
API Reference: https://api.highcharts.com/highcharts/series.column.data.color API 参考: https://api.highcharts.com/highcharts/series.column.data.color
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.