I'm trying to export an image using canvg. It works fine on Chrome and Firefox but it doesn't on Internet Explorer, it changes to resulted image. With IE it also needs to be saved as SVG file and exported afterwards.
The snippet where the thing is done:
const svg = document.getElementsByClassName("rtmchart")[0];
const canvas = document.createElement('canvas');
const data = new XMLSerializer().serializeToString(svg);
const opts = { log: true, ignoreMouse: true, ignoreAnimation: true };
canvg(canvas, data, opts);
svgWrapper = $(svg);
canvasWrapper = $(canvas);
svgWrapper.hide();
canvasWrapper.insertAfter(svgWrapper);
css/less:
g.bb-region.forecast-region {
fill-opacity: 1;
fill: url(#forecastRegionFilter);
}
#forecastRegionFilter {
rect {
fill:skyblue;
fill-opacity: 0.3;
}
line {
stroke:black;
stroke-width: 2px;
}
}
This is how the export looks with Chrome (the same as the original image):
And here is the broken image exported with IE:
Any ideas how to solve this problem?