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_TICKS"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>Ticks</b></div>
9
<i>(Defined in: jpgraph.php : 3942)</i><table border=1><tr><td>&nbsp;<a href="Ticks.html" style="font-family:arial;font-weight:bold;color:darkblue;">Ticks</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="Ticks.html#_TICKS_SET">Set()</a>&nbsp;<br>
10
&nbsp;<a href="Ticks.html#_TICKS_SETCOLOR">SetColor()</a>&nbsp;<br>
11
&nbsp;<a href="Ticks.html#_TICKS_SETFORMATCALLBACK">SetFormatCallback()</a>&nbsp;<br>
12
&nbsp;<a href="Ticks.html#_TICKS_SETLABELFORMAT">SetLabelFormat()</a>&nbsp;<br>
13
&nbsp;<a href="Ticks.html#_TICKS_SETSIDE">SetSide()</a>&nbsp;<br>
14
&nbsp;<a href="Ticks.html#_TICKS_SETSIZE">SetSize()</a>&nbsp;<br>
15
&nbsp;<a href="Ticks.html#_TICKS_SETWEIGHT">SetWeight()</a>&nbsp;<br>
16
&nbsp;<a href="Ticks.html#_TICKS_SUPRESSFIRST">SupressFirst()</a>&nbsp;<br>
17
&nbsp;<a href="Ticks.html#_TICKS_SUPRESSLAST">SupressLast()</a>&nbsp;<br>
18
&nbsp;<a href="Ticks.html#_TICKS_SUPRESSMINORTICKMARKS">SupressMinorTickMarks()</a>&nbsp;<br>
19
&nbsp;<a href="Ticks.html#_TICKS_SUPRESSTICKMARKS">SupressTickMarks()</a>&nbsp;<br>
20
&nbsp;<a href="Ticks.html#_TICKS_SUPRESSZEROLABEL">SupressZeroLabel()</a>&nbsp;<br>
21
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>This is the abstract base class for ticks. Specifying the common signature for both linear and logartihmic ticks.
22
 
23
Ticks are normally a property of the scale and can be accessed via the $graph->scale->ticks property.
24
 <p> &nbsp;
25
<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
26
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SET"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
27
function&nbsp;Set($aMaj,$aMin)</font>
28
</b></div></a></span>
29
 
30
<span style='font-family:arial;font-size:90%;'><i>Set the distance between major and minor tick marks</i></span><p>
31
 
32
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
33
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
34
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
35
$aMaj</font>
36
 
37
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Distance (world coordinates) for major tick marks</td></tr>
38
 
39
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
40
$aMin</font>
41
 
42
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Distance (world coordinates) for minor tick marks</td></tr>
43
</table>
44
 
45
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set the distance between major and minor tick marks. Note that when the scale is specified manually then the tick marks must also be specified manually.&nbsp;<br>
46
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Graph.html#_GRAPH_SETSCALE">Graph::SetScale</a>
47
<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">
48
$graph-&gt;yaxis-&gt;scale-&gt;ticks-&gt;Set(10,5);
<br /></font>
49
</span><br>
50
<p>
51
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_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">
52
function&nbsp;SetColor($aMajorColor,$aMinorColor)</font>
53
</b></div></a></span>
54
55
 
56
57
 
58
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
59
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
60
$aMajorColor</font>
61
62
 
63
64
 
65
$aMinorColor</font>
66
67
 
68
""</font>
69
</td><td>Minor tick mark color</td></tr>
70
</table>
71
72
 
73
74
 
75
$graph-&gt;yaxis-&gt;scale-&gt;ticks-&gt;SetColor('red','black');
<br /></font>
76
</span><br>
77
<p>
78
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_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">
79
function&nbsp;SetFormatCallback($aCallbackFuncName)</font>
80
</b></div></a></span>
81
82
<span style='font-family:arial;font-size:90%;'><i>Specify a format callback function for labels</i></span><p>
83
 
84
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
85
 
86
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
87
$aCallbackFuncName</font>
88
89
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>name of function</td></tr>
90
 
91
92
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specifies a callback function which will be called and given each tick label in turn as the argument. The callback function is supposed to return a proper formatted label to be displayed.
93
 
94
Note: There is a shortcut to this method through the Axis::SetLabelFormatCallback.
95
 
96
Note 2: The PHP function number_format() is often usefull in callback functions.
97
 
98
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Axis.html#_AXIS_SETLABELFORMATCALLBACK">Axis::SetLabelFormatCallback</a>
99
<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">
100
//&nbsp;Callback&nbsp;function&nbsp;for&nbsp;Y-scale.&nbsp;Use&nbsp;money&nbsp;format&nbsp;with
<br />//&nbsp;a&nbsp;','&nbsp;to&nbsp;separate&nbsp;1000:s
<br />function&nbsp;yScaleCallback($aVal)&nbsp;{
<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;number_format($aVal);
<br />}
<br />
<br />
<br />//&nbsp;Short&nbsp;for&nbsp;$graph-&gt;yaxis-&gt;scale-&gt;ticks-&gt;SetFormatCallback()
<br />$graph-&gt;yaxis-&gt;SetLabelFormatCallback('yScaleCallback');
<br />
<br /></font>
101
</span><br>
102
<p>
103
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SETLABELFORMAT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
104
function&nbsp;SetLabelFormat($aFormatString,$aDate)</font>
105
</b></div></a></span>
106
107
<span style='font-family:arial;font-size:90%;'><i>Set format string for automatic labels</i></span><p>
108
109
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
110
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
111
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
112
$aFormatString</font>
113
114
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Specify a printf() style format string</td></tr>
115
116
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
117
$aDate</font>
118
 
119
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
120
 
121
</td><td>No description available</td></tr>
122
</table>
123
124
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a printf() style format string.
125
 
126
Note: Can also be called trough the shortcut Axis::SetLabelFormatString()
127
 
128
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Ticks.html#_TICKS_SETFORMATCALLBACK">Ticks::SetFormatCallback</a>
129
<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">
130
 
131
</span><br>
132
<p>
133
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SETSIDE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
134
function&nbsp;SetSide($aSide)</font>
135
 
136
137
 
138
139
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
140
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
141
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
142
$aSide</font>
143
144
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Side</td></tr>
145
</table>
146
147
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Synonym for SetDirection().
148
 
149
150
 
151
<li>SIDE_LEFT
152
<li>SIDE_RIGHT
153
</ul>
154
155
 
156
157
<ul>
158
 
159
<li> SIDE_DOWN
160
</ul>&nbsp;<br>
161
 
162
<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">
163
$graph-&gt;xaxis-&gt;scale-&gt;ticks-&gt;SetSide(SIDE_UP);
<br /></font>
164
</span><br>
165
<p>
166
 
167
function&nbsp;SetSize($aMajSize,$aMinSize)</font>
168
 
169
170
<span style='font-family:arial;font-size:90%;'><i>Specify absolute size of tick marks in pixels</i></span><p>
171
172
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
173
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
174
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
175
$aMajSize</font>
176
177
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Major tick size</td></tr>
178
179
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
180
$aMinSize</font>
181
182
 
183
3</font>
184
 
185
</table>
186
187
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify absolute size of tick marks in pixels&nbsp;<br>
188
189
 
190
$graph-&gt;xaxis-&gt;scale-&gt;ticks-&gt;SetSize(8,3);</font>
191
 
192
<p>
193
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SETWEIGHT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
194
 
195
</b></div></a></span>
196
197
<span style='font-family:arial;font-size:90%;'><i>Specify width of tick marks</i></span><p>
198
199
 
200
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
201
 
202
$aWeight</font>
203
204
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Width (in pixels)</td></tr>
205
</table>
206
207
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify width of tick marks&nbsp;<br>
208
209
 
210
$graph-&gt;xaxis-&gt;scale-&gt;ticks-&gt;SetWeight(2);</font>
211
 
212
<p>
213
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SUPRESSFIRST"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
214
function&nbsp;SupressFirst($aHide)</font>
215
</b></div></a></span>
216
 
217
<span style='font-family:arial;font-size:90%;'><i>Hide the first tick mark</i></span><p>
218
219
 
220
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
221
 
222
$aHide</font>
223
224
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
225
true</font>
226
</td><td>True=Hide the vbery first tick mark on the axis</td></tr>
227
</table>
228
229
 
230
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Ticks.html#_TICKS_SUPRESSLAST">Ticks::SupressLast</a>
231
 
232
$graph-&gt;xaxis-&gt;scale-&gt;ticks-&gt;SupressFirst();
<br /></font>
233
</span><br>
234
<p>
235
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SUPRESSLAST"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
236
 
237
</b></div></a></span>
238
239
<span style='font-family:arial;font-size:90%;'><i>Hide the last tick mark</i></span><p>
240
241
 
242
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
243
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
244
$aHide</font>
245
246
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
247
true</font>
248
</td><td>True=Hide the last tick mark</td></tr>
249
</table>
250
251
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Hide the last tick mark on the axis&nbsp;<br>
252
 
253
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SUPRESSMINORTICKMARKS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
254
 
255
</b></div></a></span>
256
257
<span style='font-family:arial;font-size:90%;'><i>Hide all minor tick marks</i></span><p>
258
259
 
260
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
261
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
262
$aHide</font>
263
264
 
265
true</font>
266
</td><td>True=Hide minor tick marks</td></tr>
267
</table>
268
269
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Hide all minor tick marks&nbsp;<br>
270
 
271
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SUPRESSTICKMARKS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
272
 
273
</b></div></a></span>
274
275
<span style='font-family:arial;font-size:90%;'><i>Hide major tick marks</i></span><p>
276
277
 
278
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
279
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
280
$aHide</font>
281
282
 
283
true</font>
284
</td><td>True=Hide major tick marks</td></tr>
285
</table>
286
287
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Hide major tick marks&nbsp;<br>
288
 
289
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_TICKS_SUPRESSZEROLABEL"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
290
 
291
</b></div></a></span>
292
293
<span style='font-family:arial;font-size:90%;'><i>Don't display the first zero label</i></span><p>
294
295
 
296
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
297
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
298
$aFlag</font>
299
300
 
301
true</font>
302
</td><td>True=Hide zero-label</td></tr>
303
</table>
304
305
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Hide any label with numeric value == 0.0&nbsp;<br>
306