ALVIN-YANG commented on issue #3564:
URL: https://github.com/apache/echarts/issues/3564#issuecomment-2550481014
测试可行的判断方法:myChart.getZr() 监听鼠标事件,根据 __legendDataIndex 有无值判断 hover的是 饼图还是
legend 组件,hover 到饼图的时候 没有 __legendDataIndex 属性,hover 到 legend 组件的时候有
```
myChart.getZr().on("mouseover", (event) => {
const legendDataIndex = event.topTarget.parent.__legendDataIndex;
if (undefined === legendDataIndex) {
return;
}
console.log("当前hover的legend 的index: ", legendDataIndex);
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]