答案 0 :(得分:1)
要隐藏click
事件上的特定点,请使用remove
方法:
plotOptions: {
networkgraph: {
...,
point: {
events: {
click: function() {
this.remove();
}
}
}
}
}
但是,networkgraph
图表中存在一个与remove
方法相关的错误(报告在这里:https://github.com/highcharts/highcharts/issues/10565),因此,您还需要使用变通方法:
Highcharts.wrap(
Highcharts.seriesTypes.networkgraph.prototype, 'generatePoints',
function(p) {
if (this.nodes) {
this.nodes.forEach(function(node) {
node.destroy();
});
this.nodes.length = 0;
}
return p.apply(this, Array.prototype.slice.call(arguments, 1));
}
);
实时演示: https://jsfiddle.net/BlackLabel/m9tjb481/
API参考: https://api.highcharts.com/class-reference/Highcharts.Point#remove