echarts 定时高亮选中

197 阅读1分钟

let curIndex = 0 setInterval(function () { let dataLen = 3;

    // 取消高亮
    eCharts.dispatchAction({type: 'downplay',seriesIndex: 0,dataIndex: curIndex})
    curIndex = curIndex + 1 > dataLen ? 0 : curIndex + 1


    //设置高亮
    eCharts.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: curIndex})

}, 300);