Zoom page echarts adaptation

How to zoom the page, echarts diagram still adapts.
1. Prepare an anti-shake function
2. Use mychart.resize()
in the echarts configuration 3. Call window.resize(()=>{ debounce(drawEchart()) }) in the update , every time the view is zoomed, The updated life cycle function will be triggered, window.resize() will be executed, and then the drawing function drawEchart() inside will be executed to redraw, which can achieve the effect of adaptation

Guess you like

Origin blog.csdn.net/weixin_44494811/article/details/107858471