Reputation: 1111
I am using the Highcharts. I want to print charts. Now the problem is I am getting the export button in the print page also which I do not want. How do I disable/hide that button in print page?
Try this fiddle- http://jsfiddle.net/6hyfk/34/
Here's highchart code
$(function () {
$('#container').highcharts({
series: [{
data: [1, 2, 3]
}]
});
$("#b").click(function() {
var chart = $('#container').highcharts();
chart.setSize(200,500, false);
chart.print();
setTimeout(function() {
chart.setSize(600,500, false);
}, 1000);
});
});
Thanks.
Upvotes: 2
Views: 1062
Reputation: 37578
You can catch the beforePrint / afterPrint events and then manipulate on SVG elements.
chart: {
events: {
beforePrint:function() {
this.exportSVGElements[0].box.hide();
this.exportSVGElements[1].hide();
},
afterPrint:function() {
this.exportSVGElements[0].box.show();
this.exportSVGElements[1].show();
}
}
},
Upvotes: 3