$("#NoBidsChart").get(0).toBlob(function(value) {
saveAs(value, "Summary.jpg");
});
Here i am using Chart JS(v2.5.0) for rendering charts. When i try to export the charts using Canvas to Blob converter and filesaver.js, i get the black background. So how do i get the image with customized background color(preferably white)?
As I stated in my comment to the accepted answer, it bothered me that the beforeDraw event causes the fillRect code to get called multiple times. (Once per data point as far as I can see.)
But I couldn't get that approach to work when called on any other event. However, I just took the coding approach described in: https://stackoverflow.com/a/50126796/165164 and plugged it into code registered to run on the afterRender event and it does just what I want: run once and leave the background white.
Please visit (and up vote) the linked answer to the other posted question.
If you want a customized background color then, you'd have to draw a background with your preferred color, and you can do so, like this ...
DEMO