当饼图设置了label,又设置了emphasis。鼠标移入时显示emphasis的内容,移出时默认显示label的内容。
const hideLabel = (e) => { myChart.setOption({ series:{ label:{ show:false } } }) } const showLabel = (e) => { myChart.setOption({ series:{ label:{ show:true } } }) } myChart.on('highlight', hideLabel) myChart.on('mouseover', hideLabel) myChart.on('mouseout', showLabel) myChart.on('downplay', showLabel)
复制
效果图如下:label默认显示:

鼠标移入时:
