单图表自适应
var myChart = echarts.init(document.getElementById("main")) window.onresize = myChart.resize;
多图表自适应
var charts = []; myChart = echarts.init(document.getElementById(‘main‘)); myChart.setOption(option); charts.push(myChart); myChart = echarts.init(document.getElementById(‘container1‘)); myChart.setOption(option); charts.push(myChart); window.onresize = function(){ for(var i = 0; i < charts.length; i++){ charts[i].resize(); } };