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_PIEPLOT"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>PiePlot</b></div>
9
<i>(Defined in: jpgraph_pie.php : 24)</i><table border=1><tr><td>&nbsp;<a href="PiePlot.html" style="font-family:arial;font-weight:bold;color:darkblue;">PiePlot</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="PiePlot.html#_PIEPLOT_EXPLODE">Explode()</a>&nbsp;<br>
10
&nbsp;<a href="PiePlot.html#_PIEPLOT_EXPLODEALL">ExplodeAll()</a>&nbsp;<br>
11
&nbsp;<a href="PiePlot.html#_PIEPLOT_EXPLODESLICE">ExplodeSlice()</a>&nbsp;<br>
12
&nbsp;<a href="PiePlot.html#_PIEPLOT_PIEPLOT">PiePlot()</a>&nbsp;<br>
13
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETCENTER">SetCenter()</a>&nbsp;<br>
14
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETCOLOR">SetColor()</a>&nbsp;<br>
15
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETCSIMTARGETS">SetCSIMTargets()</a>&nbsp;<br>
16
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETFONT">SetFont()</a>&nbsp;<br>
17
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETFONTCOLOR">SetFontColor()</a>&nbsp;<br>
18
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETGUIDELINES">SetGuideLines()</a>&nbsp;<br>
19
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETGUIDELINESADJUST">SetGuideLinesAdjust()</a>&nbsp;<br>
20
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETLABELPOS">SetLabelPos()</a>&nbsp;<br>
21
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETLABELS">SetLabels()</a>&nbsp;<br>
22
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETLABELTYPE">SetLabelType()</a>&nbsp;<br>
23
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETLEGENDS">SetLegends()</a>&nbsp;<br>
24
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETSHADOW">SetShadow()</a>&nbsp;<br>
25
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETSIZE">SetSize()</a>&nbsp;<br>
26
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETSLICECOLORS">SetSliceColors()</a>&nbsp;<br>
27
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETSTARTANGLE">SetStartAngle()</a>&nbsp;<br>
28
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETTHEME">SetTheme()</a>&nbsp;<br>
29
&nbsp;<a href="PiePlot.html#_PIEPLOT_SETVALUETYPE">SetValueType()</a>&nbsp;<br>
30
&nbsp;<a href="PiePlot.html#_PIEPLOT_SHOWBORDER">ShowBorder()</a>&nbsp;<br>
31
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>Creates a new Pie plot from the supplied data. <p>
32
By default the value (if enabled through the $pie->label->show() ) close to each slice will have a label corresponding to the percentage of that slice.
33
<p>
34
Each plot may have an arbitrary title which can be accessed through the ?title? property in the PiePlot class. The title will be automatically centred on top of the PiePlot clear of any possible labels. To set the title use the Set() method , i.e. $plot->title->Set(?MyTitle?).
35
<p>
36
To format the slice labels use the SetFormat() method of the value class. <p> &nbsp;
37
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="PieGraph.html">PieGraph</a> and <a href="PiePlot3D.html">PiePlot3D</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
38
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_EXPLODE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
39
function&nbsp;Explode($aExplodeArr)</font>
40
</b></div></a></span>
41
 
42
<span style='font-family:arial;font-size:90%;'><i>Explode one or more slices as specified radius.</i></span><p>
43
 
44
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
45
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
46
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
47
$aExplodeArr</font>
48
 
49
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Explode specification</td></tr>
50
</table>
51
 
52
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>To emphasise a specific slice it can be exploded, i.e moved out fro the center of the pie plot. This method will allow you to specify what slices and to waht radius you want them exploded.
53
<p>
54
If you only want to explode a single slice you could also use the ExplodeSlice() method.
55
&nbsp;<br>
56
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_EXPLODESLICE">PiePlot::ExplodeSlice</a>
57
<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">
58
//To&nbsp;explode&nbsp;slice&nbsp;0,2&nbsp;to&nbsp;radius&nbsp;100&nbsp;you&nbsp;would&nbsp;call
<br />$pieplot-&gt;Explode(array(100,0,100));
<br /></font>
59
</span><br>
60
<p>
61
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_EXPLODEALL"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
62
function&nbsp;ExplodeAll($radius)</font>
63
</b></div></a></span>
64
65
<span style='font-family:arial;font-size:90%;'><i>Explode all slices a specified amount</i></span><p>
66
 
67
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
68
 
69
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
70
$radius</font>
71
72
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
73
 
74
</td><td>Explode radius</td></tr>
75
</table>
76
77
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Explode all slices a specified amount. If no radius is specified it will default to 20 pixels.&nbsp;<br>
78
 
79
<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">
80
$p1-&gt;ExplodeAll();
<br /></font>
81
</span><br>
82
<p>
83
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_EXPLODESLICE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
84
function&nbsp;ExplodeSlice($e,$radius)</font>
85
</b></div></a></span>
86
87
<span style='font-family:arial;font-size:90%;'><i>Explode a single slice a specified radius</i></span><p>
88
89
 
90
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
91
 
92
$e</font>
93
94
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Which slice to explode</td></tr>
95
96
 
97
$radius</font>
98
 
99
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
100
20</font>
101
 
102
</table>
103
104
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Explode a single slice to a specific radius.&nbsp;<br>
105
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_EXPLODE">PiePlot::Explode</a> and <a href="PiePlot.html#_PIEPLOT_EXPLODEALL">PiePlot::ExplodeAll</a>
106
 
107
//&nbsp;Explode&nbsp;slice&nbsp;number&nbsp;2&nbsp;(the&nbsp;third&nbsp;slice)&nbsp;using&nbsp;the&nbsp;default
<br />//&nbsp;explode&nbsp;radius.
<br />$pieplot-&gt;ExplodeSlice(2);</font>
108
</span><br>
109
<p>
110
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_PIEPLOT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
111
function&nbsp;PiePlot($data)</font>
112
</b></div></a></span>
113
114
<span style='font-family:arial;font-size:90%;'><i>Constructor for PiePlots</i></span><p>
115
116
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
117
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
118
 
119
$data</font>
120
 
121
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Data array for Pie</td></tr>
122
</table>
123
124
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Construct a new pie plot which later can be added to Piegraph&nbsp;<br>
125
 
126
<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">
127
$pieplot&nbsp;=&nbsp;new&nbsp;PiePlot($slicedata);
<br />$piegraph-&gt;Add($pieplot);
<br /></font>
128
 
129
<p>
130
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETCENTER"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
131
function&nbsp;SetCenter($x,$y)</font>
132
</b></div></a></span>
133
134
<span style='font-family:arial;font-size:90%;'><i>//---------------// PUBLIC METHODS
135
</i></span><p>
136
137
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
138
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
139
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
140
 
141
142
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X-position as fraction of width</td></tr>
143
 
144
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
145
$y</font>
146
147
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
148
 
149
</td><td>Y-position as fraction of height</td></tr>
150
 
151
152
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set the center point for the PiePlot&nbsp;<br>
153
 
154
<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">
155
$pieplot-&gt;SetCenter(0.4,0.5);
<br /></font>
156
</span><br>
157
<p>
158
 
159
function&nbsp;SetColor($aColor)</font>
160
</b></div></a></span>
161
162
<span style='font-family:arial;font-size:90%;'><i>Specify frame color for pie.</i></span><p>
163
164
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
165
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
166
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
167
$aColor</font>
168
169
 
170
</table>
171
 
172
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set the color of the border around each slice.&nbsp;<br>
173
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_SETSLICECOLORS">PiePlot::SetSliceColors</a>
174
<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">
175
$pieplot-&gt;SetColor('red');</font>
176
 
177
<p>
178
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETCSIMTARGETS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
179
 
180
</b></div></a></span>
181
182
<span style='font-family:arial;font-size:90%;'><i>Specify URL targets for image maps</i></span><p>
183
184
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
185
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
186
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
187
$targets</font>
188
189
 
190
191
 
192
$alts</font>
193
194
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
195
null</font>
196
 
197
</table>
198
 
199
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify  list of targets for the image map for each slice. The target should be a fully qualified URL.
200
<p>
201
 
202
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_GETCSIMAREAS">PiePlot::GetCSIMareas</a>
203
<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">
204
$targets&nbsp;=&nbsp;array('godetail1.html',&nbsp;'gotodetail2.html'&nbsp;'gotodetail3.html');
<br />$alts&nbsp;=&nbsp;array('Year&nbsp;%d',&nbsp;'Year&nbsp;%d',&nbsp;'Year&nbsp;%d');
<br />
<br />$pieplot-&gt;SetCSIMTargets($targets,$alts);</font>
205
</span><br>
206
 
207
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETFONT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
208
function&nbsp;SetFont($family,$style,$size)</font>
209
</b></div></a></span>
210
211
<span style='font-family:arial;font-size:90%;'><i>Deprecated. Use $pieplot->value->SetFont() instead.</i></span><p>
212
213
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
214
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
215
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
216
$family</font>
217
218
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Font family</td></tr>
219
220
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
221
 
222
223
 
224
FS_NORMAL</font>
225
</td><td>Font style</td></tr>
226
227
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
228
 
229
230
 
231
10</font>
232
</td><td>Font size</td></tr>
233
 
234
235
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Deprecated. Use $pieplot->value->SetFont() instead.&nbsp;<br>
236
237
 
238
//Deprecated.&nbsp;Use&nbsp;$pieplot-&gt;value-&gt;SetFont()&nbsp;instead.</font>
239
</span><br>
240
 
241
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETFONTCOLOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
242
function&nbsp;SetFontColor($aColor)</font>
243
</b></div></a></span>
244
245
 
246
247
 
248
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
249
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
250
$aColor</font>
251
252
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color</td></tr>
253
</table>
254
255
 
256
257
 
258
//Deprecated.&nbsp;Use&nbsp;$pieplot-&gt;value-&gt;SetFontColor()&nbsp;instead.</font>
259
</span><br>
260
<p>
261
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETGUIDELINES"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
262
 
263
</b></div></a></span>
264
265
 
266
267
 
268
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
269
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
270
$aFlg</font>
271
272
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
273
true</font>
274
</td><td>TRUE=Enable guide lines</td></tr>
275
 
276
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
277
 
278
279
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
280
true</font>
281
</td><td>Curve the labels around the pie</td></tr>
282
 
283
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
284
$aAlways</font>
285
286
 
287
false</font>
288
</td><td>Always use a guide line to the label</td></tr>
289
 
290
291
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Enable guideline and set drawing policy for guide lines and labels&nbsp;<br>
292
293
 
294
$pieplot-&gt;SetGuideLines();</font>
295
</span><br>
296
 
297
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETGUIDELINESADJUST"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
298
function&nbsp;SetGuideLinesAdjust($aVFactor,$aRFactor)</font>
299
</b></div></a></span>
300
301
 
302
303
 
304
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
305
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
306
$aVFactor</font>
307
308
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Vertical fraction</td></tr>
309
310
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
311
 
312
313
 
314
0.8</font>
315
</td><td>Radius factor</td></tr>
316
</table>
317
318
 
319
320
 
321
$graph-&gt;xaxis-&gt;scale-&gt;SetGuideLinesAdjust(1.7);</font>
322
</span><br>
323
 
324
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETLABELPOS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
325
function&nbsp;SetLabelPos($aLblPosAdj)</font>
326
</b></div></a></span>
327
328
 
329
330
 
331
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
332
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
333
$aLblPosAdj</font>
334
335
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Position as fraction of radius</td></tr>
336
</table>
337
338
 
339
<p>
340
 
341
&nbsp;<br>
342
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_SETLABELS">PiePlot::SetLabels</a>
343
<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">
344
$p1&nbsp;=&nbsp;new&nbsp;PiePlot($data);
<br />$p1-&gt;SetLabelPos(0.6);
<br />$graph-&gt;Add($p1);
<br /></font>
345
 
346
<p>
347
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETLABELS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
348
 
349
</b></div></a></span>
350
351
<span style='font-family:arial;font-size:90%;'><i>Specify individual text labels for all slices</i></span><p>
352
353
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
354
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
355
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
356
$aLabels</font>
357
358
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Arrays of strings</td></tr>
359
360
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
361
$aLblPosAdj</font>
362
363
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
364
 
365
</td><td>Position as fraction of the radius</td></tr>
366
 
367
368
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Normally pie slice gets assigned a label which displays either the percentage or the absolute value of a slice. These automtically asigned labels are positioned in a ring around the pie.
369
<br>
370
However, you can also manually assign a label to each slice individually with this method.
371
 
372
Each label can contain format specification so for example the label
373
 
374
"May %.1f%%"
375
<p>
376
 
377
<p>
378
The second parameter specifies where to position these labels. The position is specified as a fraction of the radius of the pie plot or as the special strine 'auto'. If you specify this string value JpGraph will automtically determine the best position for the labels inside the pie. This is the default if you don't explicitely specify the position.
379
<p>
380
If you specify a value > 1.0 then the labels will
381
 
382
<p>
383
Note: The actual alignment of the labels are dependent on the position. If the labels are just outside the pie they will be individually positioned according to the angle. If the labels are positioned inside the pie then the point of gravity within the text will be aligned with the specified position in the pie.
384
385
&nbsp;<br>
386
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_SETLABELTYPE">PiePlot::SetLabelType</a>
387
<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">
388
$p1-&gt;SetLabelType(PIE_VALUE_PER);
<br />$lbl&nbsp;=&nbsp;array("adam\n%.1f%%","bertil\n%.1f%%","kalle\n%.1f%%","peter\n%.1f%%","daniel\n%.1f%%","erik\n%.1f%%");
<br />$p1-&gt;SetLabels($lbl);
<br /></font>
389
</span><br>
390
<p>
391
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETLABELTYPE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
392
function&nbsp;SetLabelType($t)</font>
393
</b></div></a></span>
394
395
<span style='font-family:arial;font-size:90%;'><i>Should we display actual value or percentage?</i></span><p>
396
397
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
398
 
399
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
400
$t</font>
401
402
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Set absolute or percentage value constant</td></tr>
403
</table>
404
405
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify if the value displayed by each slice (if the $pieplot->value->Show()) have been called shold be absolute or in percent.
406
<p>
407
The following values are allowed arguments:
408
<ul>
409
<li>PIE_VALUE_ABS
410
<li>PIE_VALUE_PER
411
 
412
<li>
413
 
414
The defauklt is to show percent.&nbsp;<br>
415
416
<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">
417
//&nbsp;Show&nbsp;absolute&nbsp;values
<br />$pieplot-&gt;SetLabelType(PIE_VALUE_ABS);
<br />
<br />//&nbsp;Display&nbsp;each&nbsp;label&nbsp;with&nbsp;postfix&nbsp;'kr',&nbsp;e.g.&nbsp;each&nbsp;label&nbsp;will
<br />//&nbsp;look&nbsp;like&nbsp;(for&nbsp;example)&nbsp;23.5&nbsp;kr
<br />$pieplot-&gt;value-&gt;SetFormat('%d&nbsp;kr');
<br />$pieplot-&gt;value-&gt;Show();
<br /></font>
418
 
419
<p>
420
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETLEGENDS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
421
 
422
</b></div></a></span>
423
424
<span style='font-family:arial;font-size:90%;'><i>// Set label arrays</i></span><p>
425
426
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
427
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
428
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
429
$aLegend</font>
430
431
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Array of strings</td></tr>
432
 
433
434
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify an array of text strings that should be used as legends for the slices.
435
<p>
436
Each text string can be formatted as a printf() format string since when printed they will be passed the value for that slice.
437
<p>
438
<b>Tip:</b> If you have many evry small slices then the labels close to the pie may be overwriting each other. In this case it is probably better to hide the labels by the slices and instead just show the values ion the legends.&nbsp;<br>
439
440
<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">
441
$legends&nbsp;=&nbsp;array('April&nbsp;(%d)','May&nbsp;(%d)','June&nbsp;(%d)');
<br />
<br />$pieplot-&gt;SetLegends($legends);
<br />
<br /></font>
442
</span><br>
443
<p>
444
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_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">
445
function&nbsp;SetShadow($aColor,$aDropWidth)</font>
446
</b></div></a></span>
447
 
448
<span style='font-family:arial;font-size:90%;'><i>Add a drop shadow to the pie slices</i></span><p>
449
 
450
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
451
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
452
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
453
$aColor</font>
454
 
455
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
456
'darkgray'</font>
457
 
458
459
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
460
$aDropWidth</font>
461
462
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
463
 
464
</td><td>Drop distance for shadow</td></tr>
465
</table>
466
467
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Add a drop shadow to the pie slices.
468
<p>
469
This is often more affective if one or more slices are exploded.&nbsp;<br>
470
471
<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">
472
//&nbsp;Explode&nbsp;all&nbsp;slices
<br />$p1-&gt;ExplodeAll(10);
<br />
<br />//&nbsp;Add&nbsp;drop&nbsp;shadow
<br />$p1-&gt;SetShadow();
<br /></font>
473
</span><br>
474
<p>
475
 
476
function&nbsp;SetSize($aSize)</font>
477
 
478
479
<span style='font-family:arial;font-size:90%;'><i>// Size in percentage</i></span><p>
480
481
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
482
 
483
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
484
$aSize</font>
485
486
 
487
</table>
488
489
 
490
<p>
491
If the value is >1 then it is interpretated as an absolute size in pixels.
492
&nbsp;<br>
493
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_SETCENTER">PiePlot::SetCenter</a>
494
 
495
$pieplot-&gt;SetSize(0.3);</font>
496
</span><br>
497
<p>
498
 
499
function&nbsp;SetSliceColors($aColors)</font>
500
</b></div></a></span>
501
502
<span style='font-family:arial;font-size:90%;'><i>Override theme coplros for slices</i></span><p>
503
504
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
505
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
506
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
507
$aColors</font>
508
509
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Array of colors</td></tr>
510
</table>
511
 
512
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Normally the colors of the slices are set according to what color-theme you are using. You can however, override this by supplying an array of colors to be used for the slices.
513
 
514
If you supply fewer colors than pie-slices than the colors will be   re-used from the beginning of the array.
515
&nbsp;<br>
516
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_SETTHEME">PiePlot::SetTheme</a>
517
<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">
518
 
519
</span><br>
520
<p>
521
 
522
function&nbsp;SetStartAngle($aStart)</font>
523
</b></div></a></span>
524
525
<span style='font-family:arial;font-size:90%;'><i>Speciy start angel for first slice</i></span><p>
526
527
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
528
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
529
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
530
$aStart</font>
531
532
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Start angle in degrees</td></tr>
533
</table>
534
 
535
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Normally the first slice is drawn at 0 degrees, i.e. 3'a clock. With this method you can adjust that to an arbitrary angle. Positive angle will rotate the slice clockwise and a negative angle will move the slice counter-clockwise.
536
 
537
The angle should be specified in degrees.
538
&nbsp;<br>
539
540
<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">
541
 
542
</span><br>
543
<p>
544
 
545
function&nbsp;SetTheme($aTheme)</font>
546
</b></div></a></span>
547
548
<span style='font-family:arial;font-size:90%;'><i>//Add the last point on the arc</i></span><p>
549
550
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
551
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
552
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
553
$aTheme</font>
554
555
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Theme name</td></tr>
556
</table>
557
 
558
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify what color theme should be used for this pie. As of version 1.6.4 the following themes are available:
559
 
560
<li> "earth"
561
<li> "pastel"
562
<li> "sand"
563
<li> "water"
564
 
565
566
<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">
567
 
568
</span><br>
569
<p>
570
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_PIEPLOT_SETVALUETYPE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
571
function&nbsp;SetValueType($aType)</font>
572
 
573
574
<span style='font-family:arial;font-size:90%;'><i>DEPRECATED: See SetLabelType()</i></span><p>
575
576
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
577
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
578
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
579
$aType</font>
580
 
581
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Value type</td></tr>
582
 
583
584
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>See SetLabelType()&nbsp;<br>
585
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="PiePlot.html#_PIEPLOT_SETLABELTYPE">PiePlot::SetLabelType</a>
586
<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">
587
 
588
</span><br>
589
<p>
590
 
591
function&nbsp;ShowBorder($exterior,$interior)</font>
592
</b></div></a></span>
593
594
<span style='font-family:arial;font-size:90%;'><i>// Should the circle around a pie plot be displayed</i></span><p>
595
596
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
597
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
598
 
599
$exterior</font>
600
601
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
602
true</font>
603
</td><td>Display circle on the outer edge of pieplot</td></tr>
604
605
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
606
$interior</font>
607
 
608
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
609
 
610
</td><td>Display the lines between each slice</td></tr>
611
</table>
612
613
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Show the lines between each slice and the border around the pie.&nbsp;<br>
614
 
615
<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">
616
//&nbsp;show&nbsp;both
<br />$pieplot-&gt;ShowBorder();</font>
617
 
618
<p> <hr> <p>