Chartjs-Export Canvas Charts to png and pdf

0👍

If you want to create a feature to allow a user to download the created charts into a image, you can use the ‘toDataURL()’ function, and specify the canvas of each chart.

To download a canvas as a pdf you can use the jsPDF library, using the above function to retrieve the canvas and then specifying the dimensions.

I may be wrong but I believe you need to create the charts and display on a web page before converting them to an image/pdf. Hope this helps!

Leave a comment