18
rated 0 times
[
25]
[
7]
/ answers: 1 / hits: 21225
/ 6 Years ago, thu, september 13, 2018, 12:00:00
I am using Chart JS library to create charts https://www.chartjs.org/
Say I have the below code
<div class=card-body >
<canvas id=bidStatus></canvas>
</div>
Using the FileSaver.js I am able to save the chart using the below code
function DownloadImage() {
$(#bidStatus).get(0).toBlob(function (blob) {
saveAs(blob, BidStatus.png);
});
}
But I am not sure how I can print the chart. Don't see any native API call to do that. Can some one please tell me how I can achieve this.
I tried using jquery print libraries which are mentioned in the Print an HTMl element example but they don't seem to load the chart generated using Chart js. I get a blank page for printing.
Thanks
More From » jquery