feat(ssr): add useViewBox opts in renderToSVGString#16272
Conversation
|
Thanks for your contribution! The pull request is marked to be Document changes are required in this PR. Please also make a PR to apache/echarts-doc for document changes and update the issue id in the PR description. When the doc PR is merged, the maintainers will remove the This PR depends on ZRender changes. Please update the ZRender dependency to the latest nightly version including this change, which takes place everyday at 8:00 UTC (16:00 Beijing Time). |
|
Congratulations! Your PR has been merged. Thanks for your contribution! 👍 |
Brief Information
This pull request is in the type of:
What does this PR do?
Add
useViewBoxopt inrenderToSVGStringmethod to make the generated SVG responsive.Related PR: #15880 (comment)
Fixed issues
#16127 (comment)
Details
Before: What was the problem?
The generated SVG has no viewBox attribute and is not responsive.
After: How is it fixed in this PR?
Use a
useViewBoxopt (default to be true) to add viewBox attribute. It's responsive now whenwidthandheightare changed.This allows use to configure
widthandheightin the CSS.Misc