• echart 柱状图折线图自动轮播


    data(){
    return{
       lbtime:"",
    option:{}
    }}
    dataZoom: [{
    startValue:0,
    endValue:4,
    }]

    option 下方加
    if (this.linechart.lineData.length > this.option.dataZoom[0].endValue) {
    this.autoMove();
    }
    加入方法
    autoMove(){
    if (this.lbtime) {
    clearInterval(this.lbtime);
    }
    this.lbtime = setInterval(() => {
    //datazoom默认显示数量<x轴数据长度时开始轮播
    if (this.option.dataZoom[0].endValue == this.linechart.lineData.length) {
    this.option.dataZoom[0].endValue = 2;
    this.option.dataZoom[0].startValue = 0;
    } else {
    this.option.dataZoom[0].endValue = this.option.dataZoom[0].endValue + 1;
    this.option.dataZoom[0].startValue = this.option.dataZoom[0].startValue + 1;
    }
    this.myChart.clear();
    this.myChart.setOption(this.option);
    // tools.loopShowTooltip(myChart, option, {loopSeries: true}); // 使用本插件
    window.onresize = this.myChart.resize();
    var option1 = this.myChart.getOption();
    this.myChart.clear();
    this.myChart.setOption(option1);
    }, 5000)
    },
    stop(){
    clearInterval(this.lbtime);
    },
    goMove(){
    this.autoMove();
    }
    鼠标移入暂停,移出开始

    $('.LineChart').mouseover(()=>{
    this.stop();
    });
    $('.LineChart').mouseout(()=>{
    this.goMove();
    });


  • 相关阅读:
    python setup.py install 失败
    Python xlsx 读取
    Java ArrayList Sort
    java console ( mac osx ) 命令行编码
    Lucene Query Term Weighting
    Fast Intro To Java Programming (2)
    随感 20150512
    循环数组中找查找某个数值
    数字内组合得到下一个比该数大的数
    android activity空指针异常解决问题解决
  • 原文地址:https://www.cnblogs.com/zhouyx/p/16379195.html
Copyright © 2020-2023  润新知