javascript - ChartJS and jsPDF - why the background is black? -
i generating pdf file using jspdf library. okay, @ page chart has white background ( on pdf - black ):
my code generating file:
var newcanvas = document.queryselector('#canvaschart'); var newcanvasimg = newcanvas.todataurl("image/jpeg", 1.0); var doc = new jspdf('landscape'); doc.setfontsize(20); doc.text(15, 15, "super cool chart"); doc.addimage(newcanvasimg, 'jpeg', 10, 10, 280, 150 ); doc.save('new-canvas.pdf');
do have idea how solve ? in advance,
Comments
Post a Comment