You must be logged in to post your query.
Home › Forums › Chart Support › Convert chart to base64 image
Tagged: image, pdf
is it possible to convert the chart to base64 image from the chart, to be able to add it into a pdf with pdfmake as suggested in
You can get base64 image data of a canvas by using toDataURL method. As CanvasJS charts are rendered on canvas, you can use toDataURL to get base64 image data of the chart. Please find the code-snippet below:
var base64Image = chart.canvas.toDataURL();
Please take a look at this JSFiddle for a working example.
Thanks for the support!
You must be logged in to reply to this topic. Login/Register