Skip to content
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

antv/g2 5.0 移除了getCanvas等方法后怎么同步拿到画布内容 #6176

Closed
luobin365304 opened this issue Apr 16, 2024 · 1 comment
Closed

Comments

@luobin365304
Copy link

问题描述

由于chart.render方法是异步的,在render后获取到的画布canvas为空画布。有什么方法可以在render后立即同步拿到画布内容
微信截图_20240416091621

重现链接

No response

重现步骤

No response

预期行为

No response

平台

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

屏幕截图或视频(可选)

No response

补充说明(可选)

No response

@hustcc
Copy link
Member

hustcc commented Apr 16, 2024

render 是一个异步的 promise ,所以要么就是 .then,要么就是 await chart.render()。

@hustcc hustcc closed this as completed Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants