iview-admin项目,echarts随屏幕全屏模式的变动而伸缩自适应

代码展示

  import echarts from 'echarts'

methods:{
    chartsResize () {
        let procedureOpenEqpChart = echarts.getInstanceByDom(document.getElementById('procedureOpenEqp'));
        let eqpOpenRateChart = echarts.getInstanceByDom(document.getElementById('eqpOpenRate'));
        let procedurePeopleChart = echarts.getInstanceByDom(document.getElementById('procedurePeople'));
        let eqpRunInfoChart = echarts.getInstanceByDom(document.getElementById('eqpRunInfo'));
        let procedureQtyChart = echarts.getInstanceByDom(document.getElementById('procedureQty'));
                
        procedureOpenEqpChart.resize();
        eqpOpenRateChart.resize();
        procedurePeopleChart.resize();
        eqpRunInfoChart.resize();
        procedureQtyChart.resize();
    }
},
mounted:{
    let _this = this;
    window.onresize = () => {
        if (!_this.isFullScreen) {
            _this.height = document.documentElement.clientHeight - 120;
        }
        etTimeout(function () {
            _this.chartsResize();
        }, 200);
    };
}

 

你可能感兴趣的:(vue,iview,echarts)