我想使用 CSS 为 Highcharts 的各个饼图切片设置样式。 Highcharts 有一种在饼图切片上设置不同颜色的方法,但我找不到通过 css 设置这些颜色的简单方法。
在进行类似搜索时出现的关于 SO 的大多数其他问题都与标签样式有关,而不是实际的 svg 路径本身。
这可能吗?如果可能的话如何?
最佳答案
通过 CSS 使用
path:nth-of-type(2){
fill: rgb(0, 0, 0) !important;
stroke: rgb(255, 255, 255);
stroke-width: 1px;
stroke-linejoin: round;
}
For other pie colors the 2 to rest of the values.
通过 JS 使用
colors : ['#4572A7', '#AA4643', '#89A54E', '#80699B', '#3D96AE',
'#DB843D', '#92A8CD', '#A47D7C', '#B5CA92'],
Inside highcharts initialization as a json obeject.
关于css - Highcharts:是否可以为单个饼图切片设置样式?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29337380/