echarts关系图节点点击事件

效果:节点和边都可以点击

 只把核心的代码贴出来了。需要的参数,可以在打印的param里面自行获取。

    this.myChart = echarts.init(document.getElementById('main'));
    this.myChart.on('click', function (param) {
      if (param.dataType == 'node') {
          console.log('点击了节点',param)
      } else {
          console.log('点击了边',param)
      }
    });

下面是param的参数:

猜你喜欢

转载自blog.csdn.net/qq_41579104/article/details/120831555