就个数组保存myChart所有实例,然后每个都调用一下resize
var charts = [];
myChart = echarts.init(document.getElementById('main'));
myChart.setOption(option);
charts.push(myChart);
myChart = echarts.init(document.getElementById('main2'旦并));
myChart.setOption(option);
charts.push(myChart);
window.onresize = function(){
for(var 昌迟搜i = 0; 耐历i < charts.length; i++){
charts[i].resize();
}
};