New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
autoFit 第一次变化有 bug #5996
Comments
autoFit 不会去监听容器变化事件,如果希望图表跟随容器,可以自己监听容器变化事件,然后调用 |
因为 G2 监听的是 window resize 事件,所以修改容器样式之后,手动出发一个 window resize 事件也可以实现。 |
@pearmini @hustcc 监听的是 window resize 事件有问题,就是容器的宽度是按照百分比给的比如 60%,当用户直接调整浏览器页面大小会触发 resize 没有问题。但是在微前端环境下,左侧菜单有可能会收起来,那么这个时候只是容器改变了大小,图表不会forceFit。 如果监听直接监听容器的大小,自己实现autoFit 为 false。new Chart({ container: eeChartRef.value, autoFit: false }) 怎么给 width 和 height 呢?因为 width 和 height 不支持 100% 这种设置。 |
|
问题描述
如图,容器动态变化,1s 后宽度变为 100px, 但是图表并没有变化重现链接
No response
重现步骤
No response
预期行为
No response
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: