Steps to reproduce:
- Open this demo.
- Click the "Export" button.
Expected results:
Charts are exported.
Current results:
No export occurs since the following lines related to canvg are commented out:
Code// import toCanvas from 'canvg';
CodeexportFromMarkup(prepareMarkup(chartSVG, formContent), {
width: 820,
height: 420,
margin: 0,
format: 'png',
svgToCanvas(svg, canvas) {
return new Promise((resolve) => {
// toCanvas(canvas, new XMLSerializer().serializeToString(svg), {
// ignoreDimensions: true,
// ignoreClear: true,
// renderCallback: resolve,
// });
});
},
});
Additional information:
- The issue is reproducible in Angular, React, and Vue, but not in jQuery or ASP.NET.
- Initial finding is that the
canvg
related codes are commented out since thecanvg
import does not work in CodeSandBox - Uncommenting the commented out code in the demo page fixes the issue