<polyline>
Baseline
Widely available
*
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
* Some parts of this feature may have varying levels of support.
<polyline> は SVG の要素で、複数の点を結ぶ直線を作成する SVG の基本図形です。一般的に polyline は開いた図形を作成するために用いられます。最後の点は最初の点に接続されている必要はないからです。閉じた図形については <polygon> 要素を参照してください。
使用コンテキスト
属性
points-
この属性は、連続線を描画するのに必要な点(x,y の絶対座標の組)のリストを定義します。 値の型: <number>+; デフォルト値:
""; アニメーション: 可 pathLength-
この属性は、パスの全長をユーザー単位で指定します。 値の型: <number>; デフォルト値: なし; アニメーション: 可
DOM インターフェイス
この要素は SVGPolylineElement インターフェイスを実装しています。
例
html
<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<!-- デフォルトの塗りつぶしによるポリラインの例 -->
<polyline points="0,100 50,25 50,75 100,0" />
<!-- 線があり塗りつぶしのない、同じポリライン図形の例 -->
<polyline points="100,100 150,25 150,75 200,0" fill="none" stroke="black" />
</svg>
仕様書
| Specification |
|---|
| Scalable Vector Graphics (SVG) 2> # PolylineElement> |