要隐藏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