We are using html2canvas.js and html2canvas.svg.js (version 0.5.0 beta1) and highcharts.js to download a donut chart into pdf.
This works as expected in Chrome, however in IE and Firefox this isnt working. In IE the chart is rendered incorrectly, and in Firefox it is not rendered at all.
Below are screenshots of the download in Chrome, IE and Firefox
The code i am using to do the html2canvas is as follows:
html2canvas($("#container"), {
onrendered: function (canvas) {
var imgData = canvas.toDataURL(
'image/png');
var doc = new jsPDF('p', 'mm');
doc.addImage(imgData, 'PNG', 10, 10);
doc.save('sample-file.pdf');
}
});
I have created a jsFiddle that demonstrates the issue here - http://jsfiddle.net/jko0rs5g/3/
Does anyone know what might be causing this issue, and how we can resolve it?
EDIT
Just to clarify why we are not using the built in Highcharts exporting, this for when we are adding additional html to the Highcarts, such as additional information above or below the chart, or a score inside the donut for example. I have updated the jsfiddle to reflect this.