antvis/G2

图表宽度设置到一定程度,X 轴文本旋转会和 legend 重叠 #5958

Darsoon posted onGitHub

问题描述

关闭 X 轴 label 的 autoEllipsis 和 autoHide,开启 autoRotate,然后改变图表宽度,当一定宽度时,图表的 label 旋转将和图例重合,但继续改变,显示又会恢复。

重现链接

https://codesandbox.io/p/sandbox/reverent-kilby-hw7ypz?file=%2Findex.ts%3A29%2C11

重现步骤

  1. 关闭 X 轴 label 的 autoEllipsis 和 autoHide,开启 autoRotate
  2. 缓慢改小图表宽度,到一定宽度能复现
  3. 如果手动拖拽不复现,可以使用 chart.changeSize 二分法,亲测稳定复现

预期行为

理论上不应该发生重叠现象

平台

  • 操作系统: macOS
  • 网页浏览器: Google Chrome

屏幕截图或视频(可选)

<img width="920" alt="image" src="https://github.com/antvis/G2/assets/15280911/57551dc7-5303-406a-a70d-09c6878b65a5">

补充说明(可选)

No response


这个 bug 是旧版本一直存在,之前的图表布局设计,无法修复,😭。可以尝试一下新版本。

posted by hustcc over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests