我正在尝试自定义 Highcharts 饼图切片的选择状态,以便在选择时不会移出。HighCharts选择状态文档为选择状态提供了“半径”选项,但这些设置对饼图没有影响:
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
plotOptions: {
series: {
allowPointSelect: true,
marker: {
states: {
select: {
radius: 0,
fillColor: '#666'
}
}
}
}
},
series: [{
data: [['Jan', 29.9], ['Feb', 71.5], ['Mar', 106.4], ['Apr', 129.2], ['May', 144.0], ['Jun', 176.0], ['Jul', 135.6], ['Aug', 148.5], ['Sep', 216.4], ['Oct', 194.1], ['Nov', 95.6], ['Dec', 54.4]]
}]
});
});
请参阅工作示例。
以下示例说明了更改所选切片的颜色,但未记录这些设置,并且添加“半径”属性无效:
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'pie'
},
plotOptions: {
series: {
allowPointSelect: true,
states: {
select: {
color: '#666'
}
}
}
},
series: [{
data: [['Jan', 29.9], ['Feb', 71.5], ['Mar', 106.4], ['Apr', 129.2], ['May', 144.0], ['Jun', 176.0], ['Jul', 135.6], ['Aug', 148.5], ['Sep', 216.4], ['Oct', 194.1], ['Nov', 95.6], ['Dec', 54.4]]
}]
});
});
查看工作示例
是否有人设法禁用饼图切片选择动画,同时仅对所选切片应用填充颜色?