antvis/G2

Draw chart into buffer/virtual canvas #3317

Destabilizator posted onGitHub

  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

I have Node.js server and want to utilize AntV G2 charting library to create chart, save it to image (cannot use base64 encoding via .toDataURL, because Google stopped displaying such images) and send it via Nodemailer. Problem is that in all the examples, AntV G2 requires a container, which I don't have when I'm server side. I've tried to utilize jsdom to create virtual container, but it doesn't work neither - throws ReferenceError: getComputedStyle is not defined. Any tips how to draw the chart on server and save it as image would be welcome.

What does the proposed API look like?

For example container in jsdom should be allowed and work, at the moment it throws ReferenceError: getComputedStyle is not defined.

<!-- generated by antv-issue-helper. DO NOT REMOVE -->


Fund this Issue

$0.00
Funded

Pull requests