Home Forums Chart Support Convert chart to base64 image Reply To: Convert chart to base64 image

#44096

@lujakob

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.

Export Chart as Base64 Image


Ananya Deka
Team CanvasJS