自适应窗口大小
为了兼容性,需要做到每个图表根据屏幕变化而自适应宽高
单个 / 多个图表均生效
mounted() {
window
.addEventListener('resize', () => {
this.chart
.resize();
});
}
或者
import resize
from './mixins/resize'
mounted() {
var _this
= this
window
.onresize = function() {
_this
.$nextTick(
_this
.DEVChart
.resize(),
)
}
},
数据更新问题
DEVoption
:{数据和配置项
}
this.DEVChart
= echarts
.init(document
.getElementById('DEVChart'))
this.DEVChart
.setOption(this.DEVoption
, true)
转载请注明原文地址: https://lol.8miu.com/read-14850.html