ChartjsNodeCanvas
ChartjsNodeCanvas copied to clipboard
Question: can we use this package to save ChartJs images to disk?
Our team is looking for a way to generate ChartJs on server-side. Our need is either
- generate a data url to pass to php script
- generate a image file to a known position so a php script can lately embed in a pdf using mPdf.
Is there an example about how to save image to disk?
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