jquery有resize()事件,但直接调用没有起作用,引入jquery.ba-resize.js文件就可以了。

例如:

<div class="chart" >
    <div ></div>
</div>

 

 

let myChart = Echarts.init(document.getElementById("myChart"));
$('.chart').resize(function () {
    myChart.resize();
});

 

相关文章: