SVG <ポリライン>


SVGポリライン-<ポリライン>

例1

<polyline>要素は、直線(複数の点で接続されている)のみで構成される形状を作成するために使用されます。

Sorry, your browser does not support inline SVG.

SVGコードは次のとおりです。

<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>

コードの説明:

  • points属性は、ポリラインを描画するために必要なポイント(x座標とy座標のペア)のリストを定義します。

例2

直線のみの別の例:

Sorry, your browser does not support inline SVG.

SVGコードは次のとおりです。

<svg height="180" width="500">
  <polyline points="0,40 40,40 40,80 80,80 80,120 120,120 120,160"
  style="fill:white;stroke:red;stroke-width:4" />
</svg>