aboutsummaryrefslogtreecommitdiff
path: root/files/fr/web/svg/element/polyline/index.html
blob: 42325ffe60052410242b76db8156a66154c50769 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
---
title: <polyline>
slug: Web/SVG/Element/polyline
tags:
  - Element
  - Graphisme
  - Reference
  - SVG
translation_of: Web/SVG/Element/polyline
---
<div>{{SVGRef}}</div>

<p>L'élément SVG <strong><code>&lt;polyline&gt;</code></strong> est une forme SVG basique qui crée des lignes entre plusieurs points. Un élément <code>polyline</code> est généralement utilisé pour créer des tracés ouverts car le dernier point n'est pas nécessairement connecté avec le premier. Lorsqu'on désire réaliser des formes fermées, on privilégiera l'élément {{SVGElement("polygon")}}.</p>

<h2 id="Contexte_d'utilisation">Contexte d'utilisation</h2>

<p>{{svginfo}}</p>

<h2 id="Attributs">Attributs</h2>

<h3 id="Attributs_universels">Attributs universels</h3>

<ul>
 <li><a href="/fr/docs/Web/SVG/Attribute#Attributs_de_traitement_conditionnel">Attributs de traitement conditionnel</a></li>
 <li><a href="/fr/docs/Web/SVG/Attribute#Attributs_de_base">Attributs principaux</a></li>
 <li><a href="/fr/docs/Web/SVG/Attribute#Attributs_d%27%C3%A9v%C3%A9nement_graphique">Attributs relatifs aux évènements graphiques</a></li>
 <li><a href="/fr/docs/Web/SVG/Attribute#Attributs_de_présentation">Attributs de présentation</a></li>
 <li>{{SVGAttr("class")}}</li>
 <li>{{SVGAttr("style")}}</li>
 <li>{{SVGAttr("externalResourcesRequired")}}</li>
 <li>{{SVGAttr("transform")}}</li>
</ul>

<h3 id="Attributs_spécifiques">Attributs spécifiques</h3>

<ul>
 <li>{{SVGAttr("points")}}</li>
</ul>

<h2 id="Interface_DOM">Interface DOM</h2>

<p>Cet élément implémente l'interface {{domxref("SVGPolylineElement")}}.</p>

<h2 id="Exemples">Exemples</h2>

<h3 id="Utilisation_basique">Utilisation basique</h3>

<h4 id="SVG">SVG</h4>

<pre class="brush: html">&lt;svg width="120" height="120" xmlns="http://www.w3.org/2000/svg"&gt;
  &lt;polyline fill="none" stroke="black"
      points="20,100 40,60 70,80 100,20"/&gt;
&lt;/svg&gt;</pre>

<h4 id="Résultat">Résultat</h4>

<p>{{EmbedLiveSample("Utilisation_basique", 120, 120)}}</p>

<h3 id="Escaliers">Escaliers</h3>

<h4 id="HTML">HTML</h4>

<pre class="brush: html">&lt;div class="contain-demo"&gt;
  &lt;svg width="150" height="200"&gt;
    &lt;desc&gt;
      Première polyligne orange avec
      remplissage blanc.
    &lt;/desc&gt;
    &lt;polyline
        points="0,40 40,40 40,80 80,80 80,120 120,120 120,160"
        fill="white" stroke="#D07735" stroke-width="6" /&gt;
  &lt;/svg&gt;
  &lt;svg width="150" height="200"&gt;
    &lt;desc&gt;
      Seconde polyligne orange avec
      remplissage jaune.
    &lt;/desc&gt;
    &lt;polyline
        points="0,40 40,40 40,80 80,80 80,120 120,120 120,160"
        fill="#F9F38C" stroke="#D07735" stroke-width="6" /&gt;
  &lt;/svg&gt;
&lt;/div&gt;
</pre>

<h4 id="CSS">CSS</h4>

<pre class="brush: css">.contain-demo {
  margin: 25px auto;
  text-align: center;
}</pre>

<h4 id="Résultat_2">Résultat</h4>

<p>{{EmbedLiveSample("Escaliers", 400, 500)}}</p>

<h2 id="Spécifications">Spécifications</h2>

<table class="standard-table">
 <thead>
  <tr>
   <th scope="col">Spécification</th>
   <th scope="col">État</th>
   <th scope="col">Commentaires</th>
  </tr>
 </thead>
 <tbody>
  <tr>
   <td>{{SpecName('SVG2', 'shapes.html#PolylineElement', '&lt;polyline&gt;')}}</td>
   <td>{{Spec2('SVG2')}}</td>
   <td> </td>
  </tr>
  <tr>
   <td>{{SpecName('SVG1.1', 'shapes.html#PolylineElement', '&lt;polyline&gt;')}}</td>
   <td>{{Spec2('SVG1.1')}}</td>
   <td>Définition initiale.</td>
  </tr>
 </tbody>
</table>

<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>

<p>{{Compat("svg.elements.polyline")}}</p>

<h2 id="Voir_aussi">Voir aussi</h2>

<ul>
 <li>{{SVGElement("line")}}</li>
 <li>{{SVGElement("polygon")}}</li>
</ul>