2019独角兽企业重金招聘Python工程师标准>>>
直接上代码
timeId=setInterval(function () {
if(count<11){
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
});
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: count
});
myChart.dispatchAction({
type: 'showTip',
seriesIndex:0 ,
dataIndex: count,
});
count++;
}else {
count=0;
}
},5000);
myChart.on('mouseover',function(par){
clearInterval(timeId);
count=par.dataIndex;
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
});
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: count
});
myChart.dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: count
});
});
myChart.on('mouseout',function(par){
timeId&&clearInterval(timeId);
timeId=setInterval(function () {
if(count<11){
myChart.dispatchAction({
type: 'downplay',
seriesIndex: 0,
});
myChart.dispatchAction({
type: 'highlight',
seriesIndex: 0,
dataIndex: count
});
myChart.dispatchAction({
type: 'showTip',
seriesIndex:0 ,
dataIndex: count,
});
count++;
}else {
count=0;
}
},5000)
});