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

how to get canvas from chart in v2?

Open mastnova opened this issue 1 year ago • 1 comments

I need to get a canvas to convert into image and print into pdf. In previous 1.x versions, I used the onReady event to get the plot and then plot.chart.getCanvas() to get the canvas. But in version 2.x this method no longer exists. How can I get the canvas?

mastnova avatar May 07 '24 20:05 mastnova

to convert canvas to image use - plot.toDataUrl('image/png')

Krupesh-21 avatar Sep 26 '24 11:09 Krupesh-21