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 Graph</h2><div class="extends"><ul>
|
|
|
19 |
<li><a href="Image.html">Image</a></li>
|
|
|
20 |
<ul><li>Graph</li></ul>
|
|
|
21 |
</ul></div><div class="description">
|
|
|
22 |
<p>
|
|
|
23 |
La classe <a href="Graph.html">Graph</a> permet de générer des graphiques, de les mettre éventuellement en cache et d'afficher le temps de génération de l'image. Il est possible de dessiner plusieurs <a href="Component.html">composants</a> sur une <a href="Image.html">image</a> de type <a href="Graph.html">Graph</a>.
|
|
|
24 |
</p>
|
|
|
25 |
</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">
|
|
|
26 |
<li>
|
|
|
27 |
<span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_RETURN">DRAW_RETURN</a> := <span class="default">1</span>
|
|
|
28 |
</li>
|
|
|
29 |
<li>
|
|
|
30 |
<span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_DISPLAY">DRAW_DISPLAY</a> := <span class="default">2</span>
|
|
|
31 |
</li>
|
|
|
32 |
</ul><ul class="properties">
|
|
|
33 |
<li>
|
|
|
34 |
<span class="access">protected</span> <span class="type">string</span> <a href="Graph.html#property.name"><span class="argument">$name</span></a> := <span class="default">NULL</span>
|
|
|
35 |
</li>
|
|
|
36 |
<li>
|
|
|
37 |
<span class="access">protected</span> <span class="type">int</span> <a href="Graph.html#property.timeout"><span class="argument">$timeout</span></a> := <span class="default">0</span>
|
|
|
38 |
</li>
|
|
|
39 |
<li>
|
|
|
40 |
<span class="access">protected</span> <span class="type">bool</span> <a href="Graph.html#property.timing"><span class="argument">$timing</span></a> := <span class="default">FALSE</span>
|
|
|
41 |
</li>
|
|
|
42 |
<li>
|
|
|
43 |
<span class="access">protected</span> <span class="type">array</span> <a href="Graph.html#property.labels"><span class="argument">$labels</span></a>
|
|
|
44 |
</li>
|
|
|
45 |
<li>
|
|
|
46 |
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Graph.html#property.title"><span class="argument">$title</span></a>
|
|
|
47 |
</li>
|
|
|
48 |
</ul><ul class="methods">
|
|
|
49 |
<li>
|
|
|
50 |
<span class="access">public</span> <a href="Graph.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$height</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$timeout</span> := <span class="default">0</span>)
|
|
|
51 |
</li>
|
|
|
52 |
<li>
|
|
|
53 |
<span class="access">public</span> <span class="type">bool</span> <a href="Graph.html#method.deleteFromCache">deleteFromCache</a>(<span class="type">string</span> <span class="argument">$name</span>)
|
|
|
54 |
</li>
|
|
|
55 |
<li>
|
|
|
56 |
<span class="access">public</span> <a href="Graph.html#method.deleteAllCache">deleteAllCache</a>()
|
|
|
57 |
</li>
|
|
|
58 |
<li>
|
|
|
59 |
<span class="access">public</span> <a href="Graph.html#method.setTiming">setTiming</a>(<span class="type">bool</span> <span class="argument">$timing</span>)
|
|
|
60 |
</li>
|
|
|
61 |
<li>
|
|
|
62 |
<span class="access">public</span> <a href="Graph.html#method.add">add</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
|
|
|
63 |
</li>
|
|
|
64 |
<li>
|
|
|
65 |
<span class="access">public</span> <a href="Graph.html#method.addLabel">addLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
|
|
|
66 |
</li>
|
|
|
67 |
<li>
|
|
|
68 |
<span class="access">public</span> <a href="Graph.html#method.addAbsLabel">addAbsLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
|
|
|
69 |
</li>
|
|
|
70 |
<li>
|
|
|
71 |
<span class="access">public</span> <span class="type">mixed</span> <a href="Graph.html#method.draw">draw</a>(<span class="type">string</span> <span class="argument">
|
|
|
72 |
$mode</span> := <span class="default">Graph::DRAW_DISPLAY</span>)
|
|
|
73 |
</li>
|
|
|
74 |
</ul><h2>Documentation</h2><ul class="doc">
|
|
|
75 |
<li class="constant">
|
|
|
76 |
<a id="constant.DRAW_RETURN"></a><span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_RETURN">DRAW_RETURN</a> := <span class="default">1</span><div class="description">
|
|
|
77 |
Pour retourner le graphique après du dessin.
|
|
|
78 |
<div class="see">
|
|
|
79 |
Voir aussi :
|
|
|
80 |
<ul><li><a href="Graph.html#method.draw">Graph::draw()</a></li></ul>
|
|
|
81 |
</div>
|
|
|
82 |
</div>
|
|
|
83 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
84 |
</li>
|
|
|
85 |
<li class="constant">
|
|
|
86 |
<a id="constant.DRAW_DISPLAY"></a><span class="access">const</span> <span class="type">int</span> <a href="Graph.html#constant.DRAW_DISPLAY">DRAW_DISPLAY</a> := <span class="default">2</span><div class="description">
|
|
|
87 |
Pour afficher le graphique après du dessin.
|
|
|
88 |
<div class="see">
|
|
|
89 |
Voir aussi :
|
|
|
90 |
<ul><li><a href="Graph.html#method.draw">Graph::draw()</a></li></ul>
|
|
|
91 |
</div>
|
|
|
92 |
</div>
|
|
|
93 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
94 |
</li>
|
|
|
95 |
<li class="property">
|
|
|
96 |
<a id="property.name"></a><span class="access">protected</span> <span class="type">string</span> <a href="Graph.html#property.name"><span class="argument">$name</span></a> := <span class="default">NULL</span><div class="description">
|
|
|
97 |
Nom du graphique.
|
|
|
98 |
Peut être laissé à NULL pour ne donner aucun nom au graphique.
|
|
|
99 |
</div>
|
|
|
100 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
101 |
</li>
|
|
|
102 |
<li class="property">
|
|
|
103 |
<a id="property.timeout"></a><span class="access">protected</span> <span class="type">int</span> <a href="Graph.html#property.timeout"><span class="argument">$timeout</span></a> := <span class="default">0</span><div class="description">
|
|
|
104 |
Peut prendre comme valeur 0 pour ne pas utiliser la mise en cache, ou spécifier un timestamp comme date d'expiration de l'image dans le cache.
|
|
|
105 |
</div>
|
|
|
106 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
107 |
</li>
|
|
|
108 |
<li class="property">
|
|
|
109 |
<a id="property.timing"></a><span class="access">protected</span> <span class="type">bool</span> <a href="Graph.html#property.timing"><span class="argument">$timing</span></a> := <span class="default">FALSE</span><div class="description">
|
|
|
110 |
Activer l'affichage du temps de génération de l'image ?
|
|
|
111 |
</div>
|
|
|
112 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
113 |
</li>
|
|
|
114 |
<li class="property">
|
|
|
115 |
<a id="property.labels"></a><span class="access">protected</span> <span class="type">array</span> <a href="Graph.html#property.labels"><span class="argument">$labels</span></a><div class="description">
|
|
|
116 |
Une liste de <a href="Label.html">Label</a> qui seront affichés sur le graphique.
|
|
|
117 |
</div>
|
|
|
118 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
119 |
</li>
|
|
|
120 |
<li class="property">
|
|
|
121 |
<a id="property.title"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="Graph.html#property.title"><span class="argument">$title</span></a><div class="description">
|
|
|
122 |
Permet de donner un titre au graphique.
|
|
|
123 |
</div>
|
|
|
124 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
125 |
</li>
|
|
|
126 |
<li class="method">
|
|
|
127 |
<a id="method.__construct"></a><span class="access">public</span> <a href="Graph.html#method.__construct">__construct</a>(<span class="type">int</span> <span class="argument">$width</span> := <span class="default">NULL</span>, <span class="type">int</span> <span class="argument">$height</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$name</span> := <span class="default">NULL</span>, <span class="type">string</span> <span class="argument">$timeout</span> := <span class="default">0</span>)
|
|
|
128 |
<div class="description">
|
|
|
129 |
Construit une image de largeur $width et de hauteur $height au nom $name (ce nom peut être laissé à NULL) et qui expirera dans le cache au timestamp $timeout. Si vous ne souhaitez pas utiliser le cache, vous pouvez laisser ce timestamp à 0.
|
|
|
130 |
$name ne représente pas le titre du graphique, c'est uniquement un moyen d'identification pour le cache.
|
|
|
131 |
</div>
|
|
|
132 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
133 |
</li>
|
|
|
134 |
<li class="method">
|
|
|
135 |
<a id="method.deleteFromCache"></a><span class="access">public</span> <span class="type">bool</span> <a href="Graph.html#method.deleteFromCache">deleteFromCache</a>(<span class="type">string</span> <span class="argument">$name</span>)
|
|
|
136 |
<div class="description">
|
|
|
137 |
Supprime manuellement l'image au nom $name du cache.
|
|
|
138 |
Cette méthode retourne TRUE si une image a été effectivement supprimée, FALSE sinon.
|
|
|
139 |
</div>
|
|
|
140 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
141 |
</li>
|
|
|
142 |
<li class="method">
|
|
|
143 |
<a id="method.deleteAllCache"></a><span class="access">public</span> <a href="Graph.html#method.deleteAllCache">deleteAllCache</a>()
|
|
|
144 |
<div class="description">
|
|
|
145 |
Supprime toutes les images mises en cache par Artichow.
|
|
|
146 |
</div>
|
|
|
147 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
148 |
</li>
|
|
|
149 |
<li class="method">
|
|
|
150 |
<a id="method.setTiming"></a><span class="access">public</span> <a href="Graph.html#method.setTiming">setTiming</a>(<span class="type">bool</span> <span class="argument">$timing</span>)
|
|
|
151 |
<div class="description">
|
|
|
152 |
Active/désactive l'affichage du temps de génération de l'image sur l'image elle-même.
|
|
|
153 |
</div>
|
|
|
154 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
155 |
</li>
|
|
|
156 |
<li class="method">
|
|
|
157 |
<a id="method.add"></a><span class="access">public</span> <a href="Graph.html#method.add">add</a>(<a href="Component.html"><span class="type">Component</span></a> <span class="argument">$component</span>)
|
|
|
158 |
<div class="description">
|
|
|
159 |
Ajoute un <a href="Component.html">composant</a> à dessiner sur l'image.
|
|
|
160 |
</div>
|
|
|
161 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
162 |
</li>
|
|
|
163 |
<li class="method">
|
|
|
164 |
<a id="method.addLabel"></a><span class="access">public</span> <a href="Graph.html#method.addLabel">addLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
|
|
|
165 |
<div class="description">
|
|
|
166 |
Ajoute une étiquette $label aux positions $x et $y.
|
|
|
167 |
Les nouvelles positions $x et $y représentent une fraction des largeur et hauteur du graphique.
|
|
|
168 |
</div>
|
|
|
169 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
170 |
</li>
|
|
|
171 |
<li class="method">
|
|
|
172 |
<a id="method.addAbsLabel"></a><span class="access">public</span> <a href="Graph.html#method.addAbsLabel">addAbsLabel</a>(<a href="Label.html"><span class="type">Label</span></a> <span class="argument">$label</span>, <a href="Point.html"><span class="type">Point</span></a> <span class="argument">$point</span>)
|
|
|
173 |
<div class="description">
|
|
|
174 |
Ajoute une étiquette $label en position absolue sur le graphique aux coordonnées X et Y spécifiées par le point $point.
|
|
|
175 |
Le point (0, 0) se situe sur le coin haut-gauche du graphique.
|
|
|
176 |
</div>
|
|
|
177 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
178 |
</li>
|
|
|
179 |
<li class="method">
|
|
|
180 |
<a id="method.draw"></a><span class="access">public</span> <span class="type">mixed</span> <a href="Graph.html#method.draw">draw</a>(<span class="type">string</span> <span class="argument">
|
|
|
181 |
$mode</span> := <span class="default">Graph::DRAW_DISPLAY</span>)
|
|
|
182 |
<div class="description">
|
|
|
183 |
Créé et affiche l'image à l'utilisateur. Tous les composants précédemment ajoutés avec <a href="Graph.html#method.add">add()</a> sont dessinés sur l'image.
|
|
|
184 |
Cette méthode appelle successivement <a href="Image.html#method.create">create()</a>, <a href="Image.html#method.drawComponent">drawComponent()</a> autant de fois que de composants ont été ajoutés et <a href="Image.html#method.send">send()</a>.
|
|
|
185 |
</div>
|
|
|
186 |
<ul class="arguments">
|
|
|
187 |
<li class="property">
|
|
|
188 |
<span class="type">string</span> <a href="Graph.html#property.mode"><span class="argument">$mode</span></a> := <span class="default">Graph::DRAW_DISPLAY</span><ul class="version"><li>
|
|
|
189 |
Disponible depuis Artichow 1.0.8</li></ul>
|
|
|
190 |
</li>
|
|
|
191 |
<li class="property">
|
|
|
192 |
<span class="type">string</span> <a href="Graph.html#property.file"><span class="argument">$file</span></a> := <span class="default">NULL</span><ul class="version"><li>
|
|
|
193 |
Supprimé à partir d'Artichow 1.0.8</li></ul>
|
|
|
194 |
<div class="description">
|
|
|
195 |
Si vous souhaitez enregistrer l'image dans un fichier plutôt qu'à l'écran, indiquez un nom de fichier destination pour le paramètre $file.
|
|
|
196 |
Ce paramètre est optionnel, et si il n'est pas rempli, alors l'image sera affichée à l'écran.
|
|
|
197 |
</div>
|
|
|
198 |
</li>
|
|
|
199 |
</ul>
|
|
|
200 |
<div class="description-bottom"><a href="Graph.html#top">Remonter</a></div>
|
|
|
201 |
</li>
|
|
|
202 |
</ul>
|
|
|
203 |
</td>
|
|
|
204 |
<td class='borderd'> </td>
|
|
|
205 |
</tr>
|
|
|
206 |
<tr>
|
|
|
207 |
<td class='cornerbg'></td>
|
|
|
208 |
<td class='borderb'> </td>
|
|
|
209 |
<td class='cornerbd'></td>
|
|
|
210 |
</tr>
|
|
|
211 |
</table>
|
|
|
212 |
</div>
|
|
|
213 |
</body>
|
|
|
214 |
</html>
|