Skip to content

Commit 2a8563f

Browse files
authored
How to Scale SVG link
1 parent 663f9f0 commit 2a8563f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

svg/dynamic-line-chart.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ I then pasted the results into the SVG and previewed it by pasting it into https
9999

100100
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.
101101

102+
[How to Scale SVG](https://css-tricks.com/scale-svg/) was useful for understanding the options here.
103+
102104
SVG images maintain their aspect ratio by default. Adding `preserveAspectRatio="none"` changed this, so the image could be distorted to fit the shape.
103105

104106
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

Comments
 (0)