SeanSobey / ChartjsNodeCanvas

A node renderer for Chart.js using canvas.
MIT License
230 stars 79 forks source link

Question: can we use this package to save ChartJs images to disk? #126

Open Mirko-Tebaldi opened 1 year ago

Mirko-Tebaldi commented 1 year ago

Our team is looking for a way to generate ChartJs on server-side. Our need is either

Is there an example about how to save image to disk?

joshuanianji commented 1 year ago

The src/example.ts gives an example of saving a chartJs image to disk using .renderToBuffer(), then fs.writeFile().

You can also generate a data url via the .renderToDataURL() function