I have seen a lot of posts describing how you can use chart.js
to create a graph using canvas
and to then save the canvas
to png, and import it into a pdf
. This is fine but what if you want to bypass the on screen part and go straight to a pdf document and include the image?
For example, I may have two buttons, one that opens the chart on screen using canvas
. This page could then handle the chart saving and importing into the pdf without a problem. The other button opens the pdf
directly. Is it possible to get the chart into this document, either saving it on the server first somehow or not?
I suspect I might be told to move over to d3 but I was just wondering if it is possible in chart.js
?