I am using "angular-chart.js"
and want to print this chart. My code is,
<html>
<head>Chart</head>
<body>
<div class="row"><b>Patient Report</b>
<div>
<canvas id="line" class="chart chart-line" data="agedata" colours="colours"
labels="labels" legend="true" series="series"click="onClick"></canvas>
</div>
</div>
<div class="row">
<a href="javascript:window.print()" class="btn btn-success">Print</a>
</div>
</body>
But it prints nothing. Can Anyone suggest me methods to print chart?
You can use the toDataURL() to make the canvas into an image (and you could use media specific CSS to hide the canvas and swap in the img with src as the Data URL when printing)
Remember to wait for the animation to end before generating the data URI or you end up with a blank image.