[转][echarts]地图轮播


代码片断:

来自:https://blog.csdn.net/qq_36947128/article/details/90899564

function Play(){
    chart.dispatchAction({
        type:"downplay",
        seriesIndex:0,

    });
    chart.dispatchAction({
        type:"highlight",
        seriesIndex:0,
        dataIndex:hourIndex
    });
    chart.dispatchAction({
        type:"showTip",
        seriesIndex:0,
        dataIndex:hourIndex
    });
    hourIndex++;
    if(hourIndex > data.length){
        hourIndex=0;
    }
}

var hourIndex=0;
var fhourTime = setInterval(Play, 3000);

//鼠标移入停止轮播
chart.on("mousemove", function(e) {
    clearInterval(fhourTime)
})
//鼠标移出恢复轮播
chart.on("mouseout", function() {
    fhourTime = setInterval(Play, 3000);
})    

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM