html5 - echarts设置容器宽高 能用rem做单位吗
PHP中文网
PHP中文网 2017-04-17 14:59:28
0
2
966

pc端页面 兼容只限于谷歌浏览器 为了自适应屏幕 用了rem做单位 不知道可不可以 求指教

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
刘奇

I solved it myself

    searchWordChart.setOption(option);
    window.addEventListener("resize", function () {
        setTimeout(function () {
            searchWordChart.resize();
        }, 500)
    });
洪涛

Yes. I have made a page implemented using rem. The map in the lower right corner is made of echarts: Example of echarts using rem

But when the user manually resizes the window, the chart will not automatically change size. You need to register the window's resize event and re-render echarts

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template