You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/12/14 04:36:57 UTC

[GitHub] [incubator-echarts] plainheart commented on a change in pull request #13732: fix(svg): fix chart cannot be exported with SVG renderer in IE.

plainheart commented on a change in pull request #13732:
URL: https://github.com/apache/incubator-echarts/pull/13732#discussion_r542106220



##########
File path: src/component/toolbox/feature/SaveAsImage.ts
##########
@@ -73,15 +73,42 @@ class SaveAsImage extends ToolboxFeature<ToolboxSaveAsImageFeatureOption> {
         }
         // IE
         else {
-            if (window.navigator.msSaveOrOpenBlob) {
-                const bstr = atob(url.split(',')[1]);
-                let n = bstr.length;
-                const u8arr = new Uint8Array(n);
-                while (n--) {
-                    u8arr[n] = bstr.charCodeAt(n);
+            if (window.navigator.msSaveOrOpenBlob || isSvg) {
+                const parts = url.split(',');
+                // data:[<mime type>][;charset=<charset>][;base64],<encoded data>
+                // see https://css-tricks.com/data-uris/

Review comment:
       Thanks for your reminder. Will remove it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org