You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: svg/dynamic-line-chart.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,8 @@ I then pasted the results into the SVG and previewed it by pasting it into https
99
99
100
100
I wanted to scale the SVG image to fit the div it was overlayed onto - which had a fixed height of 60px but a variable width.
101
101
102
+
[How to Scale SVG](https://css-tricks.com/scale-svg/) was useful for understanding the options here.
103
+
102
104
SVG images maintain their aspect ratio by default. Adding `preserveAspectRatio="none"` changed this, so the image could be distorted to fit the shape.
103
105
104
106
Unfortunately this has a visual impact on the line of the graph - causing it to be wider and narrower at different angles. We decided that this brush-stroke effect was actually OK for our purposes.
0 commit comments