We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hi, I tried to export the image as jpeg but because of the way canvas handles transparency, the background becomes black:
The fix is adding a white rectangle to the background, like this:
plugins: { beforeDraw: function (chart, easing) { var ctx = chart.chart.ctx; ctx.save(); ctx.fillStyle = "#ffffff"; ctx.fillRect(0, 0, chart.width, chart.height); ctx.restore(); } }
Maybe this info can be added to wiki or depending on the output, it can be added automatically.
The text was updated successfully, but these errors were encountered:
Thanks for this! Saved me some headache.
Sorry, something went wrong.
Thank you @el I can't understand why chartjs doesn't have a native background property for this purpose.
background
Thanks! This is very useful!
No branches or pull requests
Hi, I tried to export the image as jpeg but because of the way canvas handles transparency, the background becomes black:
The fix is adding a white rectangle to the background, like this:
Maybe this info can be added to wiki or depending on the output, it can be added automatically.
The text was updated successfully, but these errors were encountered: