日常改bug时,发现echarts饼图鼠标悬浮上去频繁闪动,把我整的以为是后端的祸害,吓的我查来查去,最后也没找到答案,只能自己来整了,给秀儿上座,看图、看代码!

1.我之前在写代码时可能是在官网复制过来的改的,就没多注意,结果还整这出,尴尬了,哈哈哈…
注:在series里的label下的show:true就可以
emphasis: {
label: {
show: false,
}
},
2.这是已解决的代码
emphasis: {
label: {
show: true,
}
},
3.看解决完之后的图

4.全部代码
chartGraphFnc7: function () {
datafromFnc = echarts.init(document.getElementById('box3'));
var option = {
backgroundColor : '#ffffff',
tooltip: {
trigger: 'item',
formatter: '{b}<br/> <b>{c}<b/>'
},
legend: {
show:true,
selectedMode:false,
bottom: '4%',
data:dataSourcesRankingDesc,
},
color:['#368cc7','#58b1d3','#8fc436', '#41b972','#279980', '#f8b741','#f0952c', '#c8551e','#da4c40', '#8f0080'],
series: [
{
name: '访问来源',
type: 'pie',
radius: ['45%', '60%'],
right: '20%',
center:['50%', '49%'],
startAngle: '90',
label: {
show: false,
position: 'center',
fontSize: 14,
color: '#333A4D',
normal: {
show: true,
formatter: '{b} \n ({d}%)'
},
},
emphasis: {
label: {
show: true,
}
},
labelLine: {
show: true
},
data: dataSourcesRankingData
}
]
};
datafromFnc.setOption(option);
},