是否可以仅禁用一个饼图的选择并保持其他饼图可选?看起来allowPointSelect
只能设置为整个系列。
答案 0 :(得分:0)
您确认allowPointSelect
只能应用于饼图的整个系列,而不能应用于该系列中的特定数据点。
但是,为了防止用户选择特定的饼图切片,您可以使用与我在this Stack Overflow answer中找到的解决方案类似的解决方案:
// pie slice on which you want to disable selections
{
name: 'Chrome',
y: 24.03,
// add event to prevent this slice from being selectable by the user
events : {
click: function(e){
e.preventDefault(); // prevent any action from occuring on "click" event
}
}
},
将此代码添加到特定切片,以防止在触发click
事件时发生任何事情。在这里添加了这个添加的小提琴:
http://jsfiddle.net/brightmatrix/vscvowmu/
你可以对其他类型的事件做同样的事情,例如`mouseOver&#39;,&#39; select&#39;等等。(见http://api.highcharts.com/highcharts/series<pie>.data.events)。
我希望这对你有所帮助!