Javascript 网络图-有没有办法在网络图中单击时隐藏特定节点?
我试图隐藏网络图中单击的节点。如何使用highcharts隐藏网络图中的节点 我已经尝试删除系列中的节点并更新图表。有更好的办法吗Javascript 网络图-有没有办法在网络图中单击时隐藏特定节点?,javascript,highcharts,Javascript,Highcharts,我试图隐藏网络图中单击的节点。如何使用highcharts隐藏网络图中的节点 我已经尝试删除系列中的节点并更新图表。有更好的办法吗 要隐藏单击事件上的特定点,请使用移除方法: 但是,networkgraph图表中存在一个与此处报告的删除方法相关的错误:,因此您还需要使用解决方法: Highcharts.wrap( Highcharts.seriesTypes.networkgraph.prototype, 'generatePoints', function(p) {
要隐藏单击事件上的特定点,请使用移除方法: 但是,networkgraph图表中存在一个与此处报告的删除方法相关的错误:,因此您还需要使用解决方法:
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));
}
);
现场演示:
API参考:
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));
}
);