[轉][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