最优的郑州网站建设,清远做网站的有哪些,深圳市网站推广公司,用dw6做网站1. 通过 myChart.getZr().on(click, fn) 监听整个图表的点击事件#xff0c;注册回调 myChart.getZr().on(click, () {//拿到index即可取出被点击数据的所有信息console.log(clickIndex)
}) 2. 在 tooltip 的 formatter 函数中#xff0c;每次调用都记录下需要的参数click, fn) 监听整个图表的点击事件注册回调 myChart.getZr().on(click, () {//拿到index即可取出被点击数据的所有信息console.log(clickIndex)
}) 2. 在 tooltip 的 formatter 函数中每次调用都记录下需要的参数一般取dataIndex在回调中使用参数 var clickIndex
let option {tooltip: axis,formatter: val {clickIndex val[0].dataIndexreturn tooltip}
} 参考: https://github.com/apache/incubator-echarts/issues/4375 转载于:https://www.cnblogs.com/qimeng/p/10238485.html