Reputation: 2035
How would I change the markup below in order to join the endpoints of the polyline.
<html>
<head>
</head>
<body>
<svg height="200" width="500">
<polyline points="20,20 40,25 60,40 80,120 120,140 200,180"
style="fill:none;stroke:black;stroke-width:3" />
</svg>
</body>
</html>
Upvotes: 0
Views: 187
Reputation: 101860
Use <polygon>
instead of <polyline>
.
<svg height="200" width="500">
<polygon points="20,20 40,25 60,40 80,120 120,140 200,180"
style="fill:none;stroke:black;stroke-width:3" />
</svg>
Upvotes: 1
Reputation: 1379
Add the first point to the end of the list:
<svg height="200" width="500">
<polyline points="20,20 40,25 60,40 80,120 120,140 200,180 20,20"
style="fill:none;stroke:black;stroke-width:3" />
</svg>
</body>
Upvotes: 0