我的期望:
代码和演示:第一个
svmlkihl1#
这个应该可以第一个
um6iljoc2#
最简单的方法是启用colorByPoint选项并定义colors数组:
colorByPoint
colors
colors: ['#2f7ed8', '#0d233a', '#8bbc21', '#910000', '#1aadce', '#492970', '#f28f43', '#77a1e5', '#c42525', '#a6c96a'], plotOptions: { column: { ... colorByPoint: true } }, ...
现场演示:http://jsfiddle.net/BlackLabel/5h09mwy2/API参考:
https://api.highcharts.com/highcharts/colorshttps://api.highcharts.com/highcharts/series.column.colorByPoint如果您只需要通过CSS执行此操作,则可以用途:
.highcharts-series-0 path:nth-child(1) { fill: red; } .highcharts-series-0 path:nth-child(2) { fill: orange; } .highcharts-series-0 path:nth-child(3) { fill: yellow; }
现场演示:http://jsfiddle.net/BlackLabel/8cmv2edz/
2条答案
按热度按时间svmlkihl1#
这个应该可以
第一个
um6iljoc2#
最简单的方法是启用
colorByPoint
选项并定义colors
数组:现场演示:http://jsfiddle.net/BlackLabel/5h09mwy2/
API参考:
https://api.highcharts.com/highcharts/colors
https://api.highcharts.com/highcharts/series.column.colorByPoint
如果您只需要通过CSS执行此操作,则可以用途:
现场演示:http://jsfiddle.net/BlackLabel/8cmv2edz/