问题
I am trying to take an image of a part of my webpage, which occasionally would include highcharts. It works well except for some highcharts type.
As an example, this is my #PrintPanelScreen on webpage.
So partial charts are displaying, check the two links below, first image shows how it looks on webpage and second image shows how it looks when rendered. Notice colors are missing on the chart.
this.PrintPanel = function () {
html2canvas(document.querySelector("#PrintPanelScreen")).then(canvas =>
{ var img = canvas.toDataURL("image/png"); // image type is "image/png"
download(img, "modified.jpg", "image/jpeg");
});
};
Image on webpage looks like this
Image after its rendered in canvas or after I open it in jpg looks like this, see colors missings
来源:https://stackoverflow.com/questions/50221267/using-htmltocanvas-for-my-webpage-but-highcharts-are-coming-partial