ant-design-charts icon indicating copy to clipboard operation
ant-design-charts copied to clipboard

[Bug]: a significant delay when the Area chart re-renders upon window resizing.

Open ReaganD opened this issue 1 month ago • 1 comments

Describe the bug / 问题描述

a significant delay when the Area chart re-renders upon window resizing.

Image

Reproduction link / 复现链接

https://stackblitz.com/edit/react-jlymsaxo-yqzhvc9m?file=index.js,package.json

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

No response

Version / 版本

🆕 2.x

OS / 操作系统

  • [ ] macOS
  • [ ] Windows
  • [ ] Linux
  • [ ] Others / 其他

Browser / 浏览器

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

ReaganD avatar Oct 29 '25 06:10 ReaganD

Hi @ReaganD! I'm Dosu and I’m helping the ant-design-charts team.

This delay is a known issue in ant-design-charts and similar chart types, often caused by how resize events trigger chart updates and resource cleanup. The root cause is usually inefficient update logic or repeated event bindings, which can degrade performance over time. There are a few workarounds and optimizations you can try:

  • Set autoFit: false in your chart config and manually control the chart's width and height to avoid unnecessary resize-triggered re-renders. This has helped mitigate resize-related rendering issues in other chart types as well (source).
  • Disable point rendering with point={false} if you don't need it, as point rendering can impact performance (source).
  • Recent updates have improved event listener management and resource cleanup during resize and destroy operations, which may help with performance (source). If possible, try upgrading to the latest patch version in the 2.x series to benefit from these fixes.

If the issue persists, it may be related to underlying bugs in the chart rendering engine (AntV G2/G2Plot), and further optimization may require changes at that level.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

dosubot[bot] avatar Oct 29 '25 07:10 dosubot[bot]