Subversion-Projekte lars-tiefland.php_share

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<style type="text/css">
2
		<!--
3
		A:link        {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
4
		A:visited     {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: none; color: #0000ff}
5
		A:hover       {font-family: helvetica, arial, geneva, sans-serif; font-size: x-small; text-decoration: underline; color: #FF0000}
6
		th            {font-family: helvetica, arial; color : blue; font-size:85%; background : lightgrey; border-right:black solid 1pt; border-bottom:black solid 1pt;}
7
		//-->
8
		</style><hr><a name="_C_BARPLOT"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>BarPlot</b> EXTENDS <a href="Plot .html#_C_PLOT " style="font-face:arial;font-weight:bold;">Plot </a></div>
9
<i>(Defined in: jpgraph_bar.php : 30)</i><table border=1><tr><td>&nbsp;<a href="BarPlot.html" style="font-family:arial;font-weight:bold;color:darkblue;">BarPlot</a>&nbsp;</td><td>&nbsp;<a href="Plot .html" style="font-family:arial;font-weight:bold;color:darkblue;">Plot </a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="BarPlot.html#_BARPLOT_BARPLOT">BarPlot()</a>&nbsp;<br>
10
&nbsp;<a href="BarPlot.html#_BARPLOT_SETABSWIDTH">SetAbsWidth()</a>&nbsp;<br>
11
&nbsp;<a href="BarPlot.html#_BARPLOT_SETALIGN">SetAlign()</a>&nbsp;<br>
12
&nbsp;<a href="BarPlot.html#_BARPLOT_SETFILLCOLOR">SetFillColor()</a>&nbsp;<br>
13
&nbsp;<a href="BarPlot.html#_BARPLOT_SETFILLGRADIENT">SetFillGradient()</a>&nbsp;<br>
14
&nbsp;<a href="BarPlot.html#_BARPLOT_SETNOFILL">SetNoFill()</a>&nbsp;<br>
15
&nbsp;<a href="BarPlot.html#_BARPLOT_SETPATTERN">SetPattern()</a>&nbsp;<br>
16
&nbsp;<a href="BarPlot.html#_BARPLOT_SETSHADOW">SetShadow()</a>&nbsp;<br>
17
&nbsp;<a href="BarPlot.html#_BARPLOT_SETVALUEPOS">SetValuePos()</a>&nbsp;<br>
18
&nbsp;<a href="BarPlot.html#_BARPLOT_SETWIDTH">SetWidth()</a>&nbsp;<br>
19
&nbsp;<a href="BarPlot.html#_BARPLOT_SETYBASE">SetYBase()</a>&nbsp;<br>
20
&nbsp;<a href="BarPlot.html#_BARPLOT_SETYMIN">SetYMin()</a>&nbsp;<br>
21
</td><td valign=top>&nbsp;</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>Concrete class which implements the standard vertical bar plot functionality.<p>
22
To show horizontal plots you can rotate the graph 90 degrees by $graph->Angle(90);
23
 <p> &nbsp;
24
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="AccBarPlot.html">AccBarPlot</a> and <a href="GroupBarPlot.html">GroupBarPlot</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
25
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_BARPLOT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
26
function&nbsp;BarPlot(&amp;$datay,$datax)</font>
27
</b></div></a></span>
28
 
29
<span style='font-family:arial;font-size:90%;'><i>Create a new bar plot</i></span><p>
30
 
31
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
32
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
33
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
34
&amp;$datay</font>
35
 
36
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Data serie</td></tr>
37
 
38
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
39
$datax</font>
40
 
41
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
42
false</font>
43
</td><td>X-positions</td></tr>
44
</table>
45
 
46
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Create a new bar plot&nbsp;<br>
47
 
48
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
49
$bar&nbsp;=&nbsp;new&nbsp;BarPlot($ydata);
<br /></font>
50
</span><br>
51
<p>
52
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETABSWIDTH"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
53
function&nbsp;SetAbsWidth($aWidth)</font>
54
</b></div></a></span>
55
56
 
57
58
 
59
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
60
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
61
$aWidth</font>
62
63
 
64
</table>
65
66
 
67
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="BarPlot.html#_BARPLOT_SETWIDTH">BarPlot::SetWidth</a>
68
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
69
$barplot-&gt;SetAbsWidth(20);
<br /></font>
70
</span><br>
71
<p>
72
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETALIGN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
73
function&nbsp;SetAlign($aAlign)</font>
74
</b></div></a></span>
75
76
<span style='font-family:arial;font-size:90%;'><i>Set the alignment between the major tick marks doe the bars.</i></span><p>
77
 
78
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
79
 
80
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
81
$aAlign</font>
82
83
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>String to specify alignment</td></tr>
84
 
85
86
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Bars can be aligned when using a text scale. Valid arguments for align are 'left', 'center' and 'right'.
87
 
88
Default is to center the bars.&nbsp;<br>
89
90
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
91
 
92
</span><br>
93
<p>
94
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETFILLCOLOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
95
function&nbsp;SetFillColor($aColor)</font>
96
</b></div></a></span>
97
98
<span style='font-family:arial;font-size:90%;'><i>Specify fill color for bars.</i></span><p>
99
100
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
101
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
102
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
103
$aColor</font>
104
105
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color specification</td></tr>
106
</table>
107
 
108
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set fill color for the bars. The color for the frame around the bar is specified with BarPlot::SetColor() method.
109
 
110
By specifying an array as argument you can assign individual colors to each of the bars. If there are more bars than colors the colros will wrap around.
111
&nbsp;<br>
112
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Plot.html#_PLOT_SETCOLOR">Plot::SetColor</a>
113
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
114
 
115
</span><br>
116
<p>
117
 
118
function&nbsp;SetFillGradient($aFromColor,$aToColor,$aStyle)</font>
119
 
120
121
<span style='font-family:arial;font-size:90%;'><i>Specify a gradient fill for the bars.</i></span><p>
122
123
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
124
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
125
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
126
$aFromColor</font>
127
128
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>No description available</td></tr>
129
130
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
131
$aToColor</font>
132
133
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
134
null</font>
135
 
136
137
 
138
$aStyle</font>
139
140
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
141
null</font>
142
 
143
</table>
144
 
145
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Gradient fill provides a smooth transition from the 'start' color to the 'end' color. The type of gradient fill can be
146
147
 
148
<li>GRAD_VER, Vertical gradient
149
<li>GRAD_HOR, Horizontal gradient
150
<li>GRAD_MIDHOR, From the center and out, horizontal
151
 
152
<li>GRAD_WIDE_MIDVER, From the center and out, vertical. Wide mid section.
153
<li>GRAD_WIDE_MIDHOR, From the center and out, horizontal. Wide mid section.
154
 
155
<li>GRAD_LEFT_REFLECTION, Simulates a reflection on the left side
156
<li>GRAD_RIGHT_REFLECTION, Simulates a reflection on the right side
157
<li>GRAD_RAISED_PANEL, Raised panel with shadow
158
</ul>
159
 
160
Since gradient fills make use of many colors and bitmapped images which doesn't use truecolor is limited to 256 colors you might find yourself out of colors if using to many different gadient fills in your graph.
161
 
162
You should also be observant that gradient fills makes use of more CPU time than solid fills.
163
&nbsp;<br>
164
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Graph.html#_GRAPH_STROKEBACKGROUNDGRAD">Graph::StrokeBackgroundGrad</a>
165
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
166
$barplot-&gt;SetFillgradient('orange','darkred',GRAD_VER);
<br /></font>
167
</span><br>
168
<p>
169
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETNOFILL"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
170
function&nbsp;SetNoFill()</font>
171
</b></div></a></span>
172
173
<span style='font-family:arial;font-size:90%;'><i>Dont's paint the interior of the bars with any color.</i></span><p>
174
 
175
176
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Bar plots are filled by default. Calling this method disable the fill of barplots.
177
178
This is usefull when you have a background in the image that you want to be shown underneth the bars.&nbsp;<br>
179
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="BarPlot.html#_BARPLOT_SETFILLCOLOR">BarPlot::SetFillColor</a>
180
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
181
$barplot-&gt;SetNoFill();
<br /></font>
182
</span><br>
183
<p>
184
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETPATTERN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
185
function&nbsp;SetPattern($aPattern,$aColor)</font>
186
</b></div></a></span>
187
188
 
189
190
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
191
 
192
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
193
 
194
195
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Pattern</td></tr>
196
197
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
198
$aColor</font>
199
200
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
201
'black'</font>
202
</td><td>Color of pattern</td></tr>
203
</table>
204
 
205
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Add one of the line patterns as fill effect to the bar.  Available patterns are:
206
 
207
<li> 'PATTERN_DIAG1'
208
<li> 'PATTERN_DIAG2'
209
<li> 'PATTERN_DIAG3'
210
<li> 'PATTERN_DIAG4'
211
 
212
<li> 'PATTERN_CROSS2'
213
 
214
<li> 'PATTERN_CROSS4'
215
<li> 'PATTERN_STRIPE1'
216
 
217
</ol>
218
&nbsp;<br>
219
220
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
221
 
222
</span><br>
223
<p>
224
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETSHADOW"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
225
function&nbsp;SetShadow($color,$hsize,$vsize,$show)</font>
226
</b></div></a></span>
227
228
<span style='font-family:arial;font-size:90%;'><i>Set a drop shadow for the bar (or rather an "up-right" shadow)</i></span><p>
229
230
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
231
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
232
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
233
$color</font>
234
235
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
236
 
237
</td><td>Shadow color</td></tr>
238
239
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
240
$hsize</font>
241
242
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
243
3</font>
244
</td><td>Horizontal size in pixels</td></tr>
245
 
246
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
247
 
248
249
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
250
3</font>
251
</td><td>Vertical size in pixels</td></tr>
252
 
253
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
254
$show</font>
255
256
 
257
true</font>
258
</td><td>TRUE=Display shadow</td></tr>
259
 
260
261
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set a drop shadow for the bar (or rather an "up-right" shadow)&nbsp;<br>
262
263
 
264
$barplot-&gt;SetShadow();
<br /></font>
265
</span><br>
266
 
267
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETVALUEPOS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
268
function&nbsp;SetValuePos($aPos)</font>
269
</b></div></a></span>
270
 
271
<span style='font-family:arial;font-size:90%;'><i>Specify position for displayed values on bars</i></span><p>
272
273
 
274
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
275
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
276
$aPos</font>
277
278
 
279
</table>
280
 
281
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify position for the values on the bar. Teh position can either be
282
<ul>
283
<li> 'top', The default value
284
<li> 'center'
285
<li> 'bottom'
286
</ul>
287
&nbsp;<br>
288
289
 
290
//&nbsp;Put&nbsp;the&nbsp;values&nbsp;in&nbsp;the&nbsp;middle&nbsp;of&nbsp;the&nbsp;bars
<br />$barplot-&gt;SetValuePos('center');</font>
291
 
292
<p>
293
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETWIDTH"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
294
function&nbsp;SetWidth($aWidth)</font>
295
</b></div></a></span>
296
 
297
<span style='font-family:arial;font-size:90%;'><i>Specify width as fractions of the major step size</i></span><p>
298
299
 
300
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
301
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
302
$aWidth</font>
303
304
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>No description available</td></tr>
305
</table>
306
307
 
308
309
If the X-axis scale is a linear scale (i.e. lin, int or date) then the width must be specified in absolute pixels.&nbsp;<br>
310
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="BarPlot.html#_BARPLOT_SETABSWIDTH">BarPlot::SetAbsWidth</a>
311
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
312
//&nbsp;Specify&nbsp;fractions&nbsp;for&nbsp;a&nbsp;text&nbsp;scale
<br />$barplot-&gt;SetWidth(0.4);
<br />
<br />//&nbsp;Specify&nbsp;absolute&nbsp;width&nbsp;25&nbsp;pixels
<br />$barplot-&gt;SetWidth(25);</font>
313
</span><br>
314
<p>
315
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETYBASE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
316
 
317
</b></div></a></span>
318
 
319
<span style='font-family:arial;font-size:90%;'><i>Specify the base value for the bars</i></span><p>
320
321
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
322
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
323
 
324
$aYStartValue</font>
325
326
 
327
</table>
328
 
329
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the start plot for bars, (minimum Y-value). By default the base uses the value 0 as base.&nbsp;<br>
330
331
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
332
$barplot-&gt;SetYBase(100);
<br /></font>
333
</span><br>
334
<p>
335
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_BARPLOT_SETYMIN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
336
function&nbsp;SetYMin($aYStartValue)</font>
337
</b></div></a></span>
338
339
<span style='font-family:arial;font-size:90%;'><i>DEPRECATED use SetYBase instead</i></span><p>
340
341
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
342
 
343
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
344
 
345
346
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Y-Value for base of bars</td></tr>
347
</table>
348
349
 
350
351
<div style="font-weight:bold;font-family:arial;font-size:85%;"><p>Example</div><span style="font-family:courier;font-size:85%;"><font color="#000000">
352
 
353
</span><br>
354