antvis/G2

[Bug]: 配置autofit后,在进行图例filter交互后触发resize会导致显示不正确 #6714

interstellarmt posted onGitHub

Describe the bug / 问题描述

https://github.com/ant-design/ant-design-charts/issues/2873

配置autoFit: true后,如果图表中存在分类图例,点击进行filter交互后,此时改变容器大小触发resize,显示不符合预期:

Image 经排查后不是饼图的特殊问题,具有普遍性,类似的还有折线图: resize前: Image resize后:

Image 面积图:

Image

https://stackblitz.com/edit/react-chvm779o-p8z7rqsw?file=src%2Findex.js

Steps to Reproduce the Bug or Issue / 重现步骤

  1. 图表存在分类图例。
  2. 配置图表属性autoFit为true。
  3. 点击图例进行filter交互。
  4. 改变图表容器大小(缩放,拖动等)
  5. 图表显示不正确。

Version / 版本

🆕 5.x

OS / 操作系统

  • macOS
  • Windows
  • Linux
  • Others / 其他

Browser / 浏览器

  • Chrome
  • Edge
  • Firefox
  • Safari (Limited support / 有限支持)
  • IE (Nonsupport / 不支持)
  • Others / 其他

Also happens with funnel chart

<img width="1707" alt="Image" src="https://github.com/user-attachments/assets/5b5de2d7-d08c-460a-96bd-baf0fca637cb" />

posted by LSTendo 28 days ago
posted by BQXBQX 27 days ago

Currently I'm using the 2.3.3 of @ant-design/plots. The next version will have this fix right ? When can we expect the next version ?

posted by LSTendo 23 days ago

about 2025-04-03, after this pr merged https://github.com/antvis/G2/pull/6709 , we will release G2 v5.3.0

posted by hustcc 23 days ago
  • @antv/g2@5.3.0
posted by hustcc 14 days ago

Fund this Issue

$0.00
Funded

Pull requests