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 BarPlot</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>BarPlot <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 histogrammes.
|
|
|
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="properties">
|
|
|
30 |
<li>
|
|
|
31 |
<span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="BarPlot.html#property.label"><span class="argument">$label</span></a>
|
|
|
32 |
</li>
|
|
|
33 |
<li>
|
|
|
34 |
<span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="BarPlot.html#property.barShadow"><span class="argument">$barShadow</span></a>
|
|
|
35 |
</li>
|
|
|
36 |
<li>
|
|
|
37 |
<span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="BarPlot.html#property.barBorder"><span class="argument">$barBorder</span></a>
|
|
|
38 |
</li>
|
|
|
39 |
</ul><ul class="methods">
|
|
|
40 |
<li>
|
|
|
41 |
<span class="access">public</span> <a href="BarPlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$identifier</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$number</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$depth</span> := <span class="default">0</span>)
|
|
|
42 |
</li>
|
|
|
43 |
<li>
|
|
|
44 |
<span class="access">public</span> <a href="BarPlot.html#method.setBarPadding">setBarPadding</a>(<span class="type">float</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">float</span> <span class="argument">$right</span> := <span class="default">NULL</span>)
|
|
|
45 |
</li>
|
|
|
46 |
<li>
|
|
|
47 |
<span class="access">public</span> <a href="BarPlot.html#method.setBarSize">setBarSize</a>(<span class="type">float</span> <span class="argument">$size</span>)
|
|
|
48 |
</li>
|
|
|
49 |
<li>
|
|
|
50 |
<span class="access">public</span> <a href="BarPlot.html#method.setBarSpace">setBarSpace</a>(<span class="type">int</span> <span class="argument">$space</span>)
|
|
|
51 |
</li>
|
|
|
52 |
<li>
|
|
|
53 |
<span class="access">public</span> <a href="BarPlot.html#method.setBarColor">setBarColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
|
|
|
54 |
</li>
|
|
|
55 |
<li>
|
|
|
56 |
<span class="access">public</span> <a href="BarPlot.html#method.setBarGradient">setBarGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
|
|
|
57 |
</li>
|
|
|
58 |
<li>
|
|
|
59 |
<span class="access">public</span> <a href="BarPlot.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
|
|
|
60 |
</li>
|
|
|
61 |
</ul><h2>Documentation</h2><ul class="doc">
|
|
|
62 |
<li class="property">
|
|
|
63 |
<a id="property.label"></a><span class="access">public</span> <a href="Label.html"><span class="type">Label</span></a> <a href="BarPlot.html#property.label"><span class="argument">$label</span></a><div class="description">
|
|
|
64 |
Représente les étiquettes affichées au-dessus de chaque barre de l'histogramme.
|
|
|
65 |
Ces étiquettes contiennent la valeur de chaque barre.
|
|
|
66 |
</div>
|
|
|
67 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
68 |
</li>
|
|
|
69 |
<li class="property">
|
|
|
70 |
<a id="property.barShadow"></a><span class="access">public</span> <a href="Shadow.html"><span class="type">Shadow</span></a> <a href="BarPlot.html#property.barShadow"><span class="argument">$barShadow</span></a><div class="description">
|
|
|
71 |
Représente l'ombre associée à chaque barre de l'histogramme.
|
|
|
72 |
</div>
|
|
|
73 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
74 |
</li>
|
|
|
75 |
<li class="property">
|
|
|
76 |
<a id="property.barBorder"></a><span class="access">public</span> <a href="Border.html"><span class="type">Border</span></a> <a href="BarPlot.html#property.barBorder"><span class="argument">$barBorder</span></a><div class="description">
|
|
|
77 |
La bordure à afficher autour de chaque barre de l'histogramme.
|
|
|
78 |
</div>
|
|
|
79 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
80 |
</li>
|
|
|
81 |
<li class="method">
|
|
|
82 |
<a id="method.__construct"></a><span class="access">public</span> <a href="BarPlot.html#method.__construct">__construct</a>(<span class="type">array</span> <span class="argument">$values</span>, <span class="type">int</span> <span class="argument">$identifier</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$number</span> := <span class="default">1</span>, <span class="type">int</span> <span class="argument">$depth</span> := <span class="default">0</span>)
|
|
|
83 |
<div class="description">
|
|
|
84 |
Créé un nouvel histogramme avec les valeurs présentes dans $values.
|
|
|
85 |
$number représente le nombre d'histogrammes affichés en parallèle tandis que $identifier permet de spécifier où se situe l'histogramme courant.
|
|
|
86 |
$depth représente la profondeur de l'histogramme en pixels.
|
|
|
87 |
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).
|
|
|
88 |
<pre>
|
|
|
89 |
|
|
|
90 |
<?php
|
|
|
91 |
|
|
|
92 |
require_once "BarPlot.class.php";
|
|
|
93 |
|
|
|
94 |
$graph = new <a href="Graph.html">Graph</a>(400, 400);
|
|
|
95 |
|
|
|
96 |
// Tableau de valeurs
|
|
|
97 |
$x = array(-19, 42, 31);
|
|
|
98 |
|
|
|
99 |
$plot = new <a href="BarPlot.html">BarPlot</a>($x);
|
|
|
100 |
$plot-><a href="Plot.html#method.setXAxisZero">setXAxisZero</a>(TRUE);
|
|
|
101 |
$plot-><a href="BarPlot.html#method.setBarColor">setBarColor</a>(
|
|
|
102 |
new <a href="Color.html">Color</a>(240, 185, 130, 20)
|
|
|
103 |
);
|
|
|
104 |
|
|
|
105 |
$graph-><a href="Graph.html#method.add">add</a>($plot);
|
|
|
106 |
$graph-><a href="Graph.html#method.draw">draw</a>();
|
|
|
107 |
|
|
|
108 |
?>
|
|
|
109 |
|
|
|
110 |
</pre>
|
|
|
111 |
</div>
|
|
|
112 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
113 |
</li>
|
|
|
114 |
<li class="method">
|
|
|
115 |
<a id="method.setBarPadding"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarPadding">setBarPadding</a>(<span class="type">float</span> <span class="argument">$left</span> := <span class="default">NULL</span>, <span class="type">float</span> <span class="argument">$right</span> := <span class="default">NULL</span>)
|
|
|
116 |
<div class="description">
|
|
|
117 |
Change l'espace interne de gauche et de droite sur chaque barre.
|
|
|
118 |
Laisser $left ou $right à NULL permet de ne pas modifier l'ancienne valeur.
|
|
|
119 |
Les valeurs données doivent être comprises entre 0 et 1 et représentent une fraction de l'espace réservé à chaque barre.
|
|
|
120 |
</div>
|
|
|
121 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
122 |
</li>
|
|
|
123 |
<li class="method">
|
|
|
124 |
<a id="method.setBarSize"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarSize">setBarSize</a>(<span class="type">float</span> <span class="argument">$size</span>)
|
|
|
125 |
<div class="description">
|
|
|
126 |
Change la taille de chaque barre pour $size.
|
|
|
127 |
Les valeurs données doivent être comprises entre 0 et 1 et représentent une fraction de l'espace réservé à chaque barre.
|
|
|
128 |
</div>
|
|
|
129 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
130 |
</li>
|
|
|
131 |
<li class="method">
|
|
|
132 |
<a id="method.setBarSpace"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarSpace">setBarSpace</a>(<span class="type">int</span> <span class="argument">$space</span>)
|
|
|
133 |
<div class="description">
|
|
|
134 |
Change l'espace entre les histogrammes affichés en parallèle pour $space.
|
|
|
135 |
</div>
|
|
|
136 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
137 |
</li>
|
|
|
138 |
<li class="method">
|
|
|
139 |
<a id="method.setBarColor"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarColor">setBarColor</a>(<a href="Color.html"><span class="type">Color</span></a> <span class="argument">$color</span>)
|
|
|
140 |
<div class="description">
|
|
|
141 |
Change la couleur des barres de l'histogrammes.
|
|
|
142 |
</div>
|
|
|
143 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
144 |
</li>
|
|
|
145 |
<li class="method">
|
|
|
146 |
<a id="method.setBarGradient"></a><span class="access">public</span> <a href="BarPlot.html#method.setBarGradient">setBarGradient</a>(<a href="Gradient.html"><span class="type">Gradient</span></a> <span class="argument">$gradient</span>)
|
|
|
147 |
<div class="description">
|
|
|
148 |
Change le dégradé de fond des barres de l'histogramme.
|
|
|
149 |
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.
|
|
|
150 |
<pre>
|
|
|
151 |
|
|
|
152 |
<?php
|
|
|
153 |
|
|
|
154 |
require_once "BarPlot.class.php";
|
|
|
155 |
|
|
|
156 |
$graph = new <a href="Graph.html">Graph</a>(400, 400);
|
|
|
157 |
|
|
|
158 |
$x = array(19, 30, 31, -42, 11);
|
|
|
159 |
|
|
|
160 |
$plot = new <a href="BarPlot.html">BarPlot</a>($x);
|
|
|
161 |
$plot-><a href="BarPlot.html#method.setBarGradient">setBarGradient</a>(
|
|
|
162 |
new <a href="LinearGradient.html">LinearGradient</a>(
|
|
|
163 |
new <a href="Color.html">Color</a>(255, 20, 20, 30),
|
|
|
164 |
new <a href="Color.html">Color</a>(20, 255, 20, 30),
|
|
|
165 |
90
|
|
|
166 |
)
|
|
|
167 |
);
|
|
|
168 |
|
|
|
169 |
$plot-><a href="Plot.html#method.setYMin">setYMin</a>(-100);
|
|
|
170 |
|
|
|
171 |
$graph-><a href="Graph.html#method.add">add</a>($plot);
|
|
|
172 |
$graph-><a href="Graph.html#method.draw">draw</a>();
|
|
|
173 |
|
|
|
174 |
?>
|
|
|
175 |
|
|
|
176 |
</pre>
|
|
|
177 |
</div>
|
|
|
178 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
179 |
</li>
|
|
|
180 |
<li class="method">
|
|
|
181 |
<a id="method.move"></a><span class="access">public</span> <a href="BarPlot.html#method.move">move</a>(<span class="type">int</span> <span class="argument">$x</span>, <span class="type">int</span> <span class="argument">$y</span>)
|
|
|
182 |
<div class="description">
|
|
|
183 |
Déplace chaque barre de $x pixels sur l'horizontale et $y pixels sur la vertical avant le dessin.
|
|
|
184 |
</div>
|
|
|
185 |
<div class="description-bottom"><a href="BarPlot.html#top">Remonter</a></div>
|
|
|
186 |
</li>
|
|
|
187 |
</ul>
|
|
|
188 |
</td>
|
|
|
189 |
<td class='borderd'> </td>
|
|
|
190 |
</tr>
|
|
|
191 |
<tr>
|
|
|
192 |
<td class='cornerbg'></td>
|
|
|
193 |
<td class='borderb'> </td>
|
|
|
194 |
<td class='cornerbd'></td>
|
|
|
195 |
</tr>
|
|
|
196 |
</table>
|
|
|
197 |
</div>
|
|
|
198 |
</body>
|
|
|
199 |
</html>
|