charts折线图有时候刷新或者打开时候缩在一团,有时候正常有时候不正常。

自己写个定时 用setInterval 然后定时检查宽度并设置宽度

    // 基于准备好的dom,初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));
    // 避免尺寸变窄
    setInterval(function () {
        if ($("#main").width() != $("#main canvas").width() && $("#main canvas").width() < $("#main").width()) {
            // myChart.resize();
            myChart.resize();
        }
    }, 100);

原创文章,作者:星辰,如若转载,请注明出处:http://www.z88j.com/51.html

(0)
打赏 微信扫一扫 微信扫一扫
上一篇 2020年9月28日 下午5:08
下一篇 2020年10月26日 上午10:15

相关推荐

发表回复

登录后才能评论

Warning: error_log(/www/wwwroot/www.z88j.com/wp-content/plugins/spider-analyser/#log/log-1916.txt): failed to open stream: No such file or directory in /www/wwwroot/www.z88j.com/wp-content/plugins/spider-analyser/spider.class.php on line 2900