SVG - Polyligne

L'élément <polyline> est utilisé pour dessiner des lignes droites connectées.

Déclaration

Voici la déclaration de syntaxe de <polyline>élément. Nous n'avons montré que les principaux attributs.

<polyline
   points="list of points" >  
</polyline>

Les attributs

N ° Sr. Nom et description
1 points - Liste des points pour constituer une polyligne.

Exemple

testSVG.htm
<html>
   <title>SVG Polyline</title>
   <body>
      
      <h1>Sample SVG Polyline Image</h1>
      
      <svg width="800" height="800">
         <g>
            <text x="0" y="15" fill="black" >Polyline #1: Without opacity.</text>
            
            <polyline points="150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5"
            stroke="black" stroke-width="3" fill="none"></polyline>
         </g>
      </svg>
   
   </body>
</html>

Production

Ouvrez textSVG.htm dans le navigateur Web Chrome. Vous pouvez utiliser Chrome / Firefox / Opera pour afficher l'image SVG directement sans aucun plugin. Internet Explorer 9 et supérieur prend également en charge le rendu d'image SVG.

Polyligne avec opacité

<html>
   <title>SVG Polyline</title>
   <body>
      
      <h1>Sample SVG Polyline Image</h1>
      
      <svg width="800" height="800">
         <g>
            <text x="0" y="15" fill="black" >Polyline #2: With opacity </text>
            
            <polyline points="150,75 258,137.5 258,262.5 150,325 42,262.6 42,137.5"
            style="fill:none;stroke-width:3;
            stroke:rgb(0,0,0);stroke-opacity:0.5;"></polyline>
         </g>
      </svg>
   
   </body>
</html>

Production

Ouvrez textSVG.htm dans le navigateur Web Chrome. Vous pouvez utiliser Chrome / Firefox / Opera pour afficher l'image SVG directement sans aucun plugin. Internet Explorer 9 et supérieur prend également en charge le rendu d'image SVG.