Open daisybaicai opened 3 years ago
apache/echarts#12778
apache/echarts#5782
myChart.dispatchAction({
type: 'hideTip'
});
myChart.dispatchAction({
type: 'updateAxisPointer',
currTrigger: 'leave'
})
myChart.dispatchAction({ type: 'hideTip' }); myChart.dispatchAction({ type: 'updateAxisPointer', currTrigger: 'leave' })
请问这个是在什么时间调用呢?
myChart.dispatchAction({ type: 'hideTip' }); myChart.dispatchAction({ type: 'updateAxisPointer', currTrigger: 'leave' })
请问这个是在什么时间调用呢?
比如你那个echarts图表,你想点击了以后出现tooltip,然后往下滚动的时候,就消失tooltip,你就绑定scroll事件。
document.addEventListener("scroll", this.handleTouch);
handleTouch(e) {
const myChart = this.chartInstance
setTimeout(() => {
myChart.dispatchAction({
type: "hideTip"
});
myChart.dispatchAction({
type: "updateAxisPointer",
currTrigger: "leave"
});
}, 0);
}
myChart.dispatchAction({ type: 'hideTip' }); myChart.dispatchAction({ type: 'updateAxisPointer', currTrigger: 'leave' })
请问这个是在什么时间调用呢?
比如你那个echarts图表,你想点击了以后出现tooltip,然后往下滚动的时候,就消失tooltip,你就绑定scroll事件。
document.addEventListener("scroll", this.handleTouch);
handleTouch(e) { const myChart = this.chartInstance setTimeout(() => { myChart.dispatchAction({ type: "hideTip" }); myChart.dispatchAction({ type: "updateAxisPointer", currTrigger: "leave" }); }, 0); }
这样会不会有性能问题:
myChart.dispatchAction({ type: 'hideTip' }); myChart.dispatchAction({ type: 'updateAxisPointer', currTrigger: 'leave' })
请问这个是在什么时间调用呢?
比如你那个echarts图表,你想点击了以后出现tooltip,然后往下滚动的时候,就消失tooltip,你就绑定scroll事件。
document.addEventListener("scroll", this.handleTouch);
handleTouch(e) { const myChart = this.chartInstance setTimeout(() => { myChart.dispatchAction({ type: "hideTip" }); myChart.dispatchAction({ type: "updateAxisPointer", currTrigger: "leave" }); }, 0); }
这样会不会有性能问题:
- 滚动事件被频繁触发,这个dispatchAction也会频繁被触发?
- 如果tooltip没有出现的话,也会调用关闭tooltip,会不会有啥问题?
仅仅是提供一个大概的思路
myChart.dispatchAction({ type: 'hideTip' }); myChart.dispatchAction({ type: 'updateAxisPointer', currTrigger: 'leave' })
请问这个是在什么时间调用呢?
比如你那个echarts图表,你想点击了以后出现tooltip,然后往下滚动的时候,就消失tooltip,你就绑定scroll事件。
document.addEventListener("scroll", this.handleTouch);
handleTouch(e) { const myChart = this.chartInstance setTimeout(() => { myChart.dispatchAction({ type: "hideTip" }); myChart.dispatchAction({ type: "updateAxisPointer", currTrigger: "leave" }); }, 0); }
这样会不会有性能问题:
- 滚动事件被频繁触发,这个dispatchAction也会频繁被触发?
- 如果tooltip没有出现的话,也会调用关闭tooltip,会不会有啥问题?
仅仅是提供一个大概的思路 嗯嗯 还是 非常感谢~
鼠标移动到下方以后,无法正常的关闭