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_DISPLAYVALUE"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>DisplayValue</b></div>
9
<i>(Defined in: jpgraph.php : 5517)</i><table border=1><tr><td>&nbsp;<a href="DisplayValue.html" style="font-family:arial;font-weight:bold;color:darkblue;">DisplayValue</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_HIDEZERO">HideZero()</a>&nbsp;<br>
10
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETALIGN">SetAlign()</a>&nbsp;<br>
11
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETANGLE">SetAngle()</a>&nbsp;<br>
12
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETCOLOR">SetColor()</a>&nbsp;<br>
13
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETFONT">SetFont()</a>&nbsp;<br>
14
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETFORMAT">SetFormat()</a>&nbsp;<br>
15
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETFORMATCALLBACK">SetFormatCallback()</a>&nbsp;<br>
16
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SETMARGIN">SetMargin()</a>&nbsp;<br>
17
&nbsp;<a href="DisplayValue.html#_DISPLAYVALUE_SHOW">Show()</a>&nbsp;<br>
18
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>Property class which is used to represent the display value for graphs. For line and bar graphs they represent the propertied of the value that can be displayed at each data point. For bars it represents the value of each bar that can be displayed at top of the bars.
19
<p>
20
This class should never be used directly instead this is an internal class which is accessed through it's instance variable, for example,
21
<p>
22
 
23
$lineplot = new LinePlot($datay);
24
// Access the instance of DisplayValue
25
$lineplot->value->Show(); <p> &nbsp;
26
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="LinePlot.html">LinePlot</a> and <a href="BarPlot.html">BarPlot</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
27
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_HIDEZERO"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
28
function&nbsp;HideZero($aFlag)</font>
29
</b></div></a></span>
30
 
31
<span style='font-family:arial;font-size:90%;'><i>Hide zero values</i></span><p>
32
 
33
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
34
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
35
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
36
$aFlag</font>
37
 
38
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
39
true</font>
40
</td><td>True=Hide zero values</td></tr>
41
</table>
42
 
43
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Hide labels that have zero value&nbsp;<br>
44
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="DisplayValue.html#_DISPLAYVALUE_SETFORMAT">DisplayValue::SetFormat</a> and <a href="DisplayValue.html#_DISPLAYVALUE_SETFORMATCALLBACK">DisplayValue::SetFormatCallback</a>
45
<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">
46
$pieplot-&gt;value-&gt;HideZero();</font>
47
</span><br>
48
<p>
49
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_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">
50
function&nbsp;SetAlign($aHAlign,$aVAlign)</font>
51
</b></div></a></span>
52
 
53
<span style='font-family:arial;font-size:90%;'><i>Specify horizontal and vertical alignment</i></span><p>
54
 
55
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
56
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
57
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
58
$aHAlign</font>
59
 
60
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Horizontal alignment</td></tr>
61
 
62
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
63
$aVAlign</font>
64
 
65
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
66
''</font>
67
</td><td>Vertical alignment</td></tr>
68
</table>
69
 
70
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the alignment of the display value in relation to the data point. Possible values are 'left', 'right', 'center'&nbsp;<br>
71
 
72
<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">
73
$lineplot-&gt;value-&gt;SetAlign('center');
<br />$lineplot-&gt;value-&gt;Show();
<br /></font>
74
</span><br>
75
<p>
76
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_SETANGLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
77
function&nbsp;SetAngle($aAngle)</font>
78
</b></div></a></span>
79
80
<span style='font-family:arial;font-size:90%;'><i>Rotate the value a specified angle</i></span><p>
81
 
82
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
83
 
84
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
85
$aAngle</font>
86
87
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Angle in degrees</td></tr>
88
 
89
90
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Roates the text label a number of degrees. 0 degrees is horizontal.
91
 
92
Please rememberthat you must use TTF fonts if you need any angle other than 0 or 90 degrees (horizontal or vertical)&nbsp;<br>
93
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="DisplayValue.html#_DISPLAYVALUE_SETFONT">DisplayValue::SetFont</a>
94
<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">
95
$bplot&nbsp;=&nbsp;new&nbsp;barPlot($datay);
<br />
<br />//&nbsp;Setup&nbsp;the&nbsp;values&nbsp;that&nbsp;are&nbsp;displayed&nbsp;on&nbsp;top&nbsp;of&nbsp;each&nbsp;bar
<br />$bplot-&gt;value-&gt;Show();
<br />
<br />//&nbsp;Must&nbsp;use&nbsp;TTF&nbsp;fonts&nbsp;if&nbsp;we&nbsp;want&nbsp;text&nbsp;at&nbsp;an&nbsp;arbitrary&nbsp;angle
<br />$bplot-&gt;value-&gt;SetFont(FF_ARIAL,FS_BOLD);
<br />$bplot-&gt;value-&gt;SetAngle(45);
<br />
<br />//&nbsp;Black&nbsp;color&nbsp;for&nbsp;positive&nbsp;values&nbsp;and&nbsp;darkred&nbsp;for&nbsp;negative&nbsp;values
<br />$bplot-&gt;value-&gt;SetColor("black","darkred");
<br /></font>
96
</span><br>
97
<p>
98
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_SETCOLOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
99
function&nbsp;SetColor($aColor,$aNegcolor)</font>
100
</b></div></a></span>
101
102
<span style='font-family:arial;font-size:90%;'><i>Specify color for values</i></span><p>
103
104
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
105
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
106
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
107
$aColor</font>
108
109
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color for positive values</td></tr>
110
111
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
112
$aNegcolor</font>
113
114
 
115
""</font>
116
 
117
</table>
118
119
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the value for the labels. You can have one color for positive and one color for negative values. If no negative color value is specified it will be the same as the positive color.&nbsp;<br>
120
121
 
122
//&nbsp;Black&nbsp;color&nbsp;for&nbsp;positive&nbsp;values&nbsp;and&nbsp;darkred&nbsp;for&nbsp;negative&nbsp;values
<br />$bplot-&gt;value-&gt;SetColor("black","darkred");
<br /></font>
123
 
124
<p>
125
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_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">
126
 
127
</b></div></a></span>
128
129
<span style='font-family:arial;font-size:90%;'><i>Specify font for values</i></span><p>
130
131
 
132
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
133
 
134
$aFontFamily</font>
135
136
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Font family</td></tr>
137
138
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
139
$aFontStyle</font>
140
141
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
142
FS_NORMAL</font>
143
 
144
145
 
146
$aFontSize</font>
147
148
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
149
10</font>
150
 
151
</table>
152
 
153
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify font for display value&nbsp;<br>
154
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="DisplayValue.html#_DISPLAYVALUE_SETANGLE">DisplayValue::SetAngle</a>
155
 
156
//&nbsp;Must&nbsp;use&nbsp;TTF&nbsp;fonts&nbsp;if&nbsp;we&nbsp;want&nbsp;text&nbsp;at&nbsp;an&nbsp;arbitrary&nbsp;angle
<br />$bplot-&gt;value-&gt;SetFont(FF_ARIAL,FS_BOLD);
<br /></font>
157
</span><br>
158
<p>
159
 
160
function&nbsp;SetFormat($aFormat,$aNegFormat)</font>
161
</b></div></a></span>
162
 
163
<span style='font-family:arial;font-size:90%;'><i>Specify printf() format string.</i></span><p>
164
165
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
166
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
167
 
168
$aFormat</font>
169
170
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Format for positive values</td></tr>
171
172
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
173
$aNegFormat</font>
174
175
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
176
""</font>
177
</td><td>Format for negative values</td></tr>
178
</table>
179
 
180
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the format string for positive and negative values. The format string follows the same riules as the standard printf() format.
181
 
182
Please remember that if you want to format a number with a '%' sign you must use double '%%' as escape format, e.g. '%01.2.f%%' will format a number with two decimal places and a following '%' sign.
183
184
&nbsp;<br>
185
186
 
187
//&nbsp;Format&nbsp;label&nbsp;as&nbsp;floating&nbsp;point&nbsp;with&nbsp;2&nbsp;decimal&nbsp;points&nbsp;and
<br />//&nbsp;a&nbsp;dollar&nbsp;sign&nbsp;in&nbsp;front,&nbsp;e.g.&nbsp;'$237.56'
<br />$bplot-&gt;SetFormt('$%01.2f');
<br /></font>
188
 
189
<p>
190
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_SETFORMATCALLBACK"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
191
 
192
</b></div></a></span>
193
194
<span style='font-family:arial;font-size:90%;'><i>Specify format callback function</i></span><p>
195
196
 
197
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
198
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
199
$aFunc</font>
200
 
201
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Name of callback function</td></tr>
202
 
203
204
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a function that get's called to format any value.&nbsp;<br>
205
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="DisplayValue.html#_DISPLAYVALUE_SETFORMAT">DisplayValue::SetFormat</a>
206
<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">
207
function&nbsp;barValueFormat($aLabel)&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Format&nbsp;'1000&nbsp;english&nbsp;style
<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;number_format($aLabel)
<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Format&nbsp;'1000&nbsp;french&nbsp;style
<br />&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;return&nbsp;number_format($aLabel,&nbsp;2,&nbsp;',',&nbsp;'&nbsp;');
<br />}
<br />
<br />$barplot-&gt;value-&gt;SetFormatCallback('barValueFormat');
<br /></font>
208
</span><br>
209
<p>
210
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_SETMARGIN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
211
function&nbsp;SetMargin($aMargin)</font>
212
</b></div></a></span>
213
 
214
<span style='font-family:arial;font-size:90%;'><i>Set nargin between value and anchor point in plot</i></span><p>
215
 
216
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
217
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
218
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
219
$aMargin</font>
220
 
221
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Margin in pixels</td></tr>
222
</table>
223
 
224
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify the margin between the data point and the label.&nbsp;<br>
225
226
<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">
227
$bplot-&gt;value-&gt;SetMargin(50);</font>
228
</span><br>
229
<p>
230
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_DISPLAYVALUE_SHOW"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
231
function&nbsp;Show($aFlag)</font>
232
</b></div></a></span>
233
234
<span style='font-family:arial;font-size:90%;'><i>Show value</i></span><p>
235
236
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
237
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
238
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
239
$aFlag</font>
240
241
 
242
true</font>
243
 
244
</table>
245
246
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Enable display of the label. If you want to display a value you must enable it since it is turned off by default.&nbsp;<br>
247
248
 
249
//&nbsp;Enable&nbsp;display&nbsp;of&nbsp;each&nbsp;slice&nbsp;value
<br />$pieplot-&gt;value-&gt;Show();
<br /></font>
250
</span><br>
251