Control the SVG size and width/height ratio
See original GitHub issueHi @timqian, Is there a easy way to control the SVG size?
I try to set width
and height
attr like this
<svg class="line-chart" width="800px" height="600px"></svg>
but it seem doesn’t work. 😃
Issue Analytics
- State:
- Created 4 years ago
- Comments:12 (6 by maintainers)
Top Results From Across the Web
How to Scale SVG | CSS-Tricks
So a rule like svg {width: 100%; height: auto;} will cancel out the dimensions and aspect ratio you set in the code, and...
Read more >preserveAspectRatio - SVG: Scalable Vector Graphics | MDN
The preserveAspectRatio attribute indicates how an element with a viewBox providing a given aspect ratio must fit into a viewport with a ...
Read more >Intrinsic Sizing - SVG
"If either/both of the 'width' and 'height' of the rootmost 'svg' element are in percentage units (or omitted), the aspect ratio is calculated...
Read more >Size and aspect ratio | Graphery SVG
You can define the SVG size with .height() and .width() , or the equivalent CSS properties. The SVG can be scaled without limitations,...
Read more >How can I make an svg scale with its parent container?
Using both max-width: 100% and max-height : 100% will make the svg always scale to the container without ever overflowing or losing its...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@timqian I’m the author of pyecharts. Echarts is a great visualization library created by Baidu frontend team.
I got an idea that combines chart.xkcd with python. Because your charts lib is so adorable and I like such hand drawing style things.
But now it just an idea and not on the shedule temporarily 😃
Try