antvis/G2

Do you want to work on this issue?

You can request for a bounty in order to promote it!

图形宽度设置百分比 #6360

Azariasa posted onGitHub

问题描述

通过设置chart的options显示图形,g2版本为5.0.3时设置的size中宽度100%,可以做到宽度自适应,升级g2版本为5.2.0后,width设置为100%后,canvas的宽度为1px

重现链接

No response

重现步骤

1、配置chart的options,截图为: image image image image 2、图形显示后的宽度为1px,效果如图所示: image

3、设置左右文本描述后,图形的提示信息发生变化,将文本的定位x,y进行了显示 image

预期行为

宽度自适应

平台

  • 操作系统: [macOS, Windows, Linux, React Native ...]
  • 网页浏览器: [Google Chrome, Safari, Firefox]

屏幕截图或视频(可选)

No response

补充说明(可选)

No response


之前能行应该是一个 bug,目前没有设计过支持设置为百分比的 API。现在的解决办法就是自己获得容器宽高,然后计算。

posted by pearmini 9 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests