Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(svg): fix chart cannot be exported with SVG renderer in IE. #13732

merged 7 commits into from Dec 18, 2020


Copy link

@plainheart plainheart commented Dec 1, 2020

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

1) fix charts cannot be exported when using SVG renderer in IE.

2) fix exported SVG file cannot be opened when using external images.
See #13655

After this fix, exporting SVG file can even be supported in IE 9.

Fixed issues


Before: What was the problem?

After: How is it fixed in this PR?


Are there any API changes?

  • The API has been changed.

Related test cases or examples to use the new APIs

Please refer to test/ie-svg-export.html.


Merging options

  • Please squash the commits into a single one when merge.

Other information

Related PR in zrender ecomfe/zrender#673

@plainheart plainheart added this to the 5.1.0 milestone Dec 1, 2020
Copy link

echarts-bot bot commented Dec 1, 2020

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

The pull request is marked to be PR: author is committer because you are a committer of this project.

Copy link

pissang commented Dec 14, 2020

Also I'm not sure if we should remove the edge condition here since edge is using chromium now

@pissang pissang modified the milestones: 5.1.0, 5.0.1 Dec 14, 2020
Copy link
Member Author

plainheart commented Dec 14, 2020

I'm not sure if we should remove the edge condition here. edge is using chromium now

@pissang I think we may need to tweak the logic of checking if the browser is Edge in zrender.
Before using chromium core, the latest version of Edge is 18.x(EdgeHTML core version). Now it's increasing from 78.x(Edge Browser Version).

Changes in zrender would be:

- const edge = ua.match(/Edge\/([\d.]+)/);
+ const edge = ua.match(/Edge?\/([\d.]+)/); // make `e` optional to match new edge with chromium core.

Old UserAgent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363

New UserAgent

Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 Edg/87.0.664.60

Related commit in zrender is ecomfe/zrender@d53d616

So, the judgment here should be:

// Chrome, Firefox, New Edge
if (typeof MouseEvent === 'function' && (env.browser.newEdge || (! && !env.browser.edge))) {

The related commit is 177f1fc

Copy link

pissang commented Dec 15, 2020

I think it looks good to me. Pin @100pah to have a further check.

Copy link

100pah commented Dec 18, 2020

It looks good to me. @plainheart

@pissang pissang merged commit eb9341c into master Dec 18, 2020
Copy link

echarts-bot bot commented Dec 18, 2020

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@pissang pissang deleted the fix-svg-export branch December 18, 2020 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

Successfully merging this pull request may close these issues.

svg image save bug on svg render with external symbol image
3 participants