我有一个使用 highchart 插件的 3d 饼图,我想在每个部分加上边框,所以我放了以下内容:
borderWidth: 4,
borderColor: "red"
在 plotOptions: pie:
中。但恐怕这些部分的边框颜色与填充的颜色相同。
有什么办法吗?我不介意边框是否为白色,但我需要区分这些部分。
这是一个 jsfiddle,您可以在其中尝试:http://jsfiddle.net/qRvn2/
JS
$(function () {
$('#container').highcharts({
chart: {
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Browser market shares at a specific website, 2014'
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
borderWidth: 4,
borderColor: "red",
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: [{
type: 'pie',
name: 'Browser share',
data: [
['Firefox', 45.0],
['IE', 26.8],
{
name: 'Chrome',
y: 12.8,
sliced: true,
selected: true
},
['Safari', 8.5],
['Opera', 6.2],
['Others', 0.7]
]
}]
});
});
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/highcharts-3d.js"></script>
<div id="container" style="height: 400px"></div>
最佳答案
这是一个错误,已报告给我们的开发人员:https://github.com/highslide-software/highcharts.com/issues/2985
关于javascript - 如何在 3d 饼图 Highcharts 上设置边框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23348977/