export default {
data() {
return {
lastIndex: 0,
}
},
methods: {
// 主动触发展示 tooltip 提示框
showTip() {
this.chartInstance.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: this.lastIndex,
});
},
// 重新渲染后隐藏 tooltip 和 axisPointer
hide() {
// 隐藏 tooltip
this.chartInstance.dispatchAction({ type: 'hideTip' });
// 隐藏 axisPointer
this.chartInstance.dispatchAction({
type: 'updateAxisPointer',
currTrigger: 'leave',
});
},
}
}