Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Mirko-Tebaldi opened this issue Dec 21, 2022 · 1 comment
Open

Comments

@Mirko-Tebaldi
Copy link

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?

@joshuanianji
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants