60 |
jpm |
1 |
<html>
|
|
|
2 |
<head>
|
|
|
3 |
<title>Documentation</title>
|
|
|
4 |
<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
|
|
|
5 |
<link rel='stylesheet' href='style.css' />
|
|
|
6 |
</head>
|
|
|
7 |
|
|
|
8 |
<body>
|
|
|
9 |
<div align='center'>
|
|
|
10 |
<table cellpadding='0' cellspacing='0' id='contenu' class='round' style='width: 80%; margin-bottom: 20px'>
|
|
|
11 |
<tr>
|
|
|
12 |
<td class='borderhg'> </td>
|
|
|
13 |
<td class='borderh'> </td>
|
|
|
14 |
<td class='cornerhd'></td>
|
|
|
15 |
</tr>
|
|
|
16 |
<tr>
|
|
|
17 |
<td class='borderg'> </td>
|
|
|
18 |
<td><a id="top"></a><h2> Class LinePlot</h2><div class="extends"><ul>
|
|
|
19 |
<li><a href="Component.html">Component</a></li>
|
|
|
20 |
<ul>
|
|
|
21 |
<li><a href="Plot.html">Plot</a></li>
|
|
|
22 |
<ul><li>LinePlot <span class="interface">implements</span> <a href="Legendable.html">Legendable</a>
|
|
|
23 |
</li></ul>
|
|
|
24 |
</ul>
|
|
|
25 |
</ul></div><div class="description">
|
|
|
26 |
<p>
|
|
|
27 |
Cette classe permet de dessiner des courbes.
|
|
|
28 |
</p>
|
|
|
29 |
</div><ul class="links"><li><a href="index.html">Retourner voir la liste de toutes les classes</a></li></ul><h2>Méthodes et propriétés</h2><ul class="constants">
|
|
|
30 |
<li>
|
|
|
31 |
<span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.LINE">LINE</a> := <span class="default">0</span>
|
|
|
32 |
</li>
|
|
|
33 |
<li>
|
|
|
34 |
<span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.MIDDLE">MIDDLE</a> := <span class="default">1</span>
|
|
|
35 |
</li>
|
|
|
36 |
</ul><ul class="properties">
|
|
|
37 |
<li>
|
|
|
38 |
<span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="LinePlot.html#property.mark"><span class="argument">$mark</span></a>
|
|
|
39 |
</li>
|
|
|
40 |
<li>
|
|
|
41 |
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="LinePlot.html#property.label"><span class="argument">$label</span></a>
|
|
|
42 |
</li>
|
|
|
43 |
</ul><ul class="methods">
|
|
|
44 |
<li>
|
|
|
45 |
<span class="access">public</span> <a href="LinePlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$mode</span> := <span class="default">LinePlor::LINE</span>)
|
|
|
46 |
</li>
|
|
|
47 |
<li>
|
|
|
48 |
<span class="access">public</span> <a href="LinePlot.html#method.hideLine">hideLine</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
|
|
|
49 |
</li>
|
|
|
50 |
<li>
|
|
|
51 |
<span class="access">public</span> <a href="LinePlot.html#method.setFilledArea">setFilledArea</a>(<span class="type">int</span> <span class="argument">$start</span>, <span class="type">int</span> <span class="argument">$stop</span>, <span class="type">mixed</span> <span class="argument">$background</span>)
|
|
|
52 |
</li>
|
|
|
53 |
<li>
|
|
|
54 |
<span class="access">public</span> <a href="LinePlot.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
|
|
|
55 |
</li>
|
|
|
56 |
<li>
|
|
|
57 |
<span class="access">public</span> <a href="LinePlot.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
|
|
|
58 |
</li>
|
|
|
59 |
<li>
|
|
|
60 |
<span class="access">public</span> <a href="LinePlot.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
|
|
|
61 |
</li>
|
|
|
62 |
<li>
|
|
|
63 |
<span class="access">public</span> <a href="LinePlot.html#method.setFillColor">setFillColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
|
|
|
64 |
</li>
|
|
|
65 |
<li>
|
|
|
66 |
<span class="access">public</span> <a href="LinePlot.html#method.setFillGradient">setFillGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
|
|
|
67 |
</li>
|
|
|
68 |
</ul><h2>Documentation</h2><ul class="doc">
|
|
|
69 |
<li class="constant">
|
|
|
70 |
<a id="constant.LINE"></a><span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.LINE">LINE</a> := <span class="default">0</span><div class="description">
|
|
|
71 |
Dessine une courbe.
|
|
|
72 |
</div>
|
|
|
73 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
74 |
</li>
|
|
|
75 |
<li class="constant">
|
|
|
76 |
<a id="constant.MIDDLE"></a><span class="access">const</span> <span class="type">int</span> <a href="LinePlot.html#constant.MIDDLE">MIDDLE</a> := <span class="default">1</span><div class="description">
|
|
|
77 |
Dessine une courbe dont les pics sont centrés sur l'axe des X (idéal pour cumuler courbe et histogramme).
|
|
|
78 |
</div>
|
|
|
79 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
80 |
</li>
|
|
|
81 |
<li class="property">
|
|
|
82 |
<a id="property.mark"></a><span class="access">public</span> <a href="Mark.html"><span class="type">Mark</span></a> <a href="LinePlot.html#property.mark"><span class="argument">$mark</span></a><div class="description">
|
|
|
83 |
Représente les marques affichées sur chaque pointe de la courbe.
|
|
|
84 |
</div>
|
|
|
85 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
86 |
</li>
|
|
|
87 |
<li class="property">
|
|
|
88 |
<a id="property.label"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="LinePlot.html#property.label"><span class="argument">$label</span></a><div class="description">
|
|
|
89 |
Représente les étiquettes affichées au-dessus de chaque pointe de la courbe.
|
|
|
90 |
Ces étiquettes contiennent la valeur de chaque pointe.
|
|
|
91 |
</div>
|
|
|
92 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
93 |
</li>
|
|
|
94 |
<li class="method">
|
|
|
95 |
<a id="method.__construct"></a><span class="access">public</span> <a href="LinePlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$mode</span> := <span class="default">LinePlor::LINE</span>)
|
|
|
96 |
<div class="description">
|
|
|
97 |
Créé une nouvelle courbe de type $mode avec les valeurs présentes dans $values.
|
|
|
98 |
Le tableau $values doit être une liste de valeurs dans un tableau incrémental, c'est-à-dire dont les clés valent de 0 à n - 1 (où n est la taille du tableau).
|
|
|
99 |
<pre>
|
|
|
100 |
|
|
|
101 |
<?php
|
|
|
102 |
|
|
|
103 |
require_once "LinePlot.class.php";
|
|
|
104 |
|
|
|
105 |
$graph = new <a href="Graph.html">Graph</a>(400, 400);
|
|
|
106 |
|
|
|
107 |
// Tableau de valeurs
|
|
|
108 |
$x = array(1, 4, 3);
|
|
|
109 |
|
|
|
110 |
$plot = new <a href="LinePlot.html">LinePlot</a>($x);
|
|
|
111 |
|
|
|
112 |
$graph-><a href="Graph.html#method.add">add</a>($plot);
|
|
|
113 |
$graph-><a href="Graph.html#method.draw">draw</a>();
|
|
|
114 |
|
|
|
115 |
?>
|
|
|
116 |
|
|
|
117 |
</pre>
|
|
|
118 |
</div>
|
|
|
119 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
120 |
</li>
|
|
|
121 |
<li class="method">
|
|
|
122 |
<a id="method.hideLine"></a><span class="access">public</span> <a href="LinePlot.html#method.hideLine">hideLine</a>(<span class="type">bool</span> <span class="argument">$hide</span>)
|
|
|
123 |
<div class="description">
|
|
|
124 |
Cache ou ne cache pas la ligne qui relie les valeurs de la courbe.
|
|
|
125 |
</div>
|
|
|
126 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
127 |
</li>
|
|
|
128 |
<li class="method">
|
|
|
129 |
<a id="method.setFilledArea"></a><span class="access">public</span> <a href="LinePlot.html#method.setFilledArea">setFilledArea</a>(<span class="type">int</span> <span class="argument">$start</span>, <span class="type">int</span> <span class="argument">$stop</span>, <span class="type">mixed</span> <span class="argument">$background</span>)
|
|
|
130 |
<div class="description">
|
|
|
131 |
Permet de remplir une aire sous la courbe des points $start à $stop.
|
|
|
132 |
L'aire sera remplie avec la couleur ou le dégradé $background.
|
|
|
133 |
</div>
|
|
|
134 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
135 |
</li>
|
|
|
136 |
<li class="method">
|
|
|
137 |
<a id="method.setColor"></a><span class="access">public</span> <a href="LinePlot.html#method.setColor">setColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
|
|
|
138 |
<div class="description">
|
|
|
139 |
Change la couleur de la ligne qui relie les valeurs de la courbe.
|
|
|
140 |
</div>
|
|
|
141 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
142 |
</li>
|
|
|
143 |
<li class="method">
|
|
|
144 |
<a id="method.setStyle"></a><span class="access">public</span> <a href="LinePlot.html#method.setStyle">setStyle</a>(<span class="type">int</span> <span class="argument">$style</span>)
|
|
|
145 |
<div class="description">
|
|
|
146 |
Change le style de ligne (<a href="Line.html#constant.SOLID">Line::SOLID</a>, <a href="Line.html#constant.DOTTED">Line::DOTTED</a> ou <a href="Line.html#constant.DASHED">Line::DASHED</a>).
|
|
|
147 |
</div>
|
|
|
148 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
149 |
</li>
|
|
|
150 |
<li class="method">
|
|
|
151 |
<a id="method.setThickness"></a><span class="access">public</span> <a href="LinePlot.html#method.setThickness">setThickness</a>(<span class="type">int</span> <span class="argument">$thickness</span>)
|
|
|
152 |
<div class="description">
|
|
|
153 |
Change l'épaisseur de la ligne.
|
|
|
154 |
L'épaisseur de la ligne doit être toujours positive.
|
|
|
155 |
</div>
|
|
|
156 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
157 |
</li>
|
|
|
158 |
<li class="method">
|
|
|
159 |
<a id="method.setFillColor"></a><span class="access">public</span> <a href="LinePlot.html#method.setFillColor">setFillColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
|
|
|
160 |
<div class="description">
|
|
|
161 |
Change la couleur de fond de la ligne qui relie les valeurs de la courbe.
|
|
|
162 |
La couleur de fond remplit le polygone définit par tous les points de la ligne additionés des points extrêmes de l'axe des abscisses.
|
|
|
163 |
<pre>
|
|
|
164 |
|
|
|
165 |
<?php
|
|
|
166 |
|
|
|
167 |
require_once "LinePlot.class.php";
|
|
|
168 |
|
|
|
169 |
$graph = new <a href="Graph.html">Graph</a>(400, 400);
|
|
|
170 |
|
|
|
171 |
$x = array(1, 10, 3, -4, 1);
|
|
|
172 |
|
|
|
173 |
$plot = new <a href="LinePlot.html">LinePlot</a>($x);
|
|
|
174 |
$plot-><a href="LinePlot.html#method.setFillColor">setFillColor</a>(new <a href="Color.html">Color</a>(255, 20, 20, 30));
|
|
|
175 |
|
|
|
176 |
$graph-><a href="Graph.html#method.add">add</a>($plot);
|
|
|
177 |
$graph-><a href="Graph.html#method.draw">draw</a>();
|
|
|
178 |
|
|
|
179 |
?>
|
|
|
180 |
|
|
|
181 |
</pre>
|
|
|
182 |
</div>
|
|
|
183 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
184 |
</li>
|
|
|
185 |
<li class="method">
|
|
|
186 |
<a id="method.setFillGradient"></a><span class="access">public</span> <a href="LinePlot.html#method.setFillGradient">setFillGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
|
|
|
187 |
<div class="description">
|
|
|
188 |
Change le dégradé de fond de la ligne qui relie les valeurs de la courbe.
|
|
|
189 |
Le dégradé de fond remplit le polygone définit par tous les points de la ligne additionés des points extrêmes de l'axe des abscisses.
|
|
|
190 |
<pre>
|
|
|
191 |
|
|
|
192 |
<?php
|
|
|
193 |
|
|
|
194 |
require_once "LinePlot.class.php";
|
|
|
195 |
|
|
|
196 |
$graph = new <a href="Graph.html">Graph</a>(400, 400);
|
|
|
197 |
|
|
|
198 |
$x = array(1, 10, 3, -4, 1);
|
|
|
199 |
|
|
|
200 |
$plot = new <a href="LinePlot.html">LinePlot</a>($x);
|
|
|
201 |
$plot-><a href="LinePlot.html#method.setFillGradient">setFillGradient</a>(
|
|
|
202 |
new <a href="LinearGradient.html">LinearGradient</a>(
|
|
|
203 |
new <a href="Color.html">Color</a>(255, 20, 20, 30),
|
|
|
204 |
new <a href="Color.html">Color</a>(20, 255, 20, 30),
|
|
|
205 |
90
|
|
|
206 |
)
|
|
|
207 |
);
|
|
|
208 |
|
|
|
209 |
$graph-><a href="Graph.html#method.add">add</a>($plot);
|
|
|
210 |
$graph-><a href="Graph.html#method.draw">draw</a>();
|
|
|
211 |
|
|
|
212 |
?>
|
|
|
213 |
|
|
|
214 |
</pre>
|
|
|
215 |
</div>
|
|
|
216 |
<div class="description-bottom"><a href="LinePlot.html#top">Remonter</a></div>
|
|
|
217 |
</li>
|
|
|
218 |
</ul>
|
|
|
219 |
</td>
|
|
|
220 |
<td class='borderd'> </td>
|
|
|
221 |
</tr>
|
|
|
222 |
<tr>
|
|
|
223 |
<td class='cornerbg'></td>
|
|
|
224 |
<td class='borderb'> </td>
|
|
|
225 |
<td class='cornerbd'></td>
|
|
|
226 |
</tr>
|
|
|
227 |
</table>
|
|
|
228 |
</div>
|
|
|
229 |
</body>
|
|
|
230 |
</html>
|