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_LINEPLOT"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>LinePlot</b> EXTENDS <a href="Plot.html#_C_PLOT" style="font-face:arial;font-weight:bold;">Plot</a></div>
9
<i>(Defined in: jpgraph_line.php : 24)</i><table border=1><tr><td>&nbsp;<a href="LinePlot.html" style="font-family:arial;font-weight:bold;color:darkblue;">LinePlot</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="LinePlot.html#_LINEPLOT_ADDAREA">AddArea()</a>&nbsp;<br>
10
&nbsp;<a href="LinePlot.html#_LINEPLOT_LINEPLOT">LinePlot()</a>&nbsp;<br>
11
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETBARCENTER">SetBarCenter()</a>&nbsp;<br>
12
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETCOLOR">SetColor()</a>&nbsp;<br>
13
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETFASTSTROKE">SetFastStroke()</a>&nbsp;<br>
14
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETFILLCOLOR">SetFillColor()</a>&nbsp;<br>
15
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETFILLFROMYMIN">SetFillFromYMin()</a>&nbsp;<br>
16
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETFILLGRADIENT">SetFillGradient()</a>&nbsp;<br>
17
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETSTEPSTYLE">SetStepStyle()</a>&nbsp;<br>
18
&nbsp;<a href="LinePlot.html#_LINEPLOT_SETSTYLE">SetStyle()</a>&nbsp;<br>
19
</td><td valign=top>&nbsp;<a href="Plot.html#_PLOT_HIDELEGEND">HideLegend()</a>&nbsp;<br>
20
&nbsp;<a href="Plot.html#_PLOT_SETCENTER">SetCenter()</a>&nbsp;<br>
21
<a href="Plot.html#_PLOT_SETCOLOR" style="color:darkgrey;">SetColor()&nbsp;</a><br>
22
&nbsp;<a href="Plot.html#_PLOT_SETCSIMTARGETS">SetCSIMTargets()</a>&nbsp;<br>
23
&nbsp;<a href="Plot.html#_PLOT_SETLEGEND">SetLegend()</a>&nbsp;<br>
24
&nbsp;<a href="Plot.html#_PLOT_SETLINEWEIGHT">SetLineWeight()</a>&nbsp;<br>
25
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>This class is used to creat line graph plots. Line graph plots are used to draw standard lineplots where datapoints are connected by lines. Each data point can also be marked by a plotmark.
26
<p>
27
A line plot can only be added to a Graph() image.
28
 
29
<b>Public properties:</b>
30
<table width=80%>
31
<tr><th width=20%> Name </th><th width=20%> Type </th><th> Description </th></tr>
32
 
33
<tr><td> mark </td> PlotMark <td></td><td> Mark at each data point </td></tr>
34
 
35
<tr><td> value </td> DisplayValue <td></td><td> Determine if and hhow each data value should be displayed in the plot </td></tr>
36
 
37
 
38
</table> <p> &nbsp;
39
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="AccLinePlot.html">AccLinePlot</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
40
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_ADDAREA"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
41
function&nbsp;AddArea($aMin,$aMax,$aFilled,$aColor,$aBorder)</font>
42
</b></div></a></span>
43
 
44
<span style='font-family:arial;font-size:90%;'><i>Create a colored area under part of the lien graph.</i></span><p>
45
 
46
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
47
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
48
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
49
$aMin</font>
50
 
51
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
52
0</font>
53
</td><td>Start X-value</td></tr>
54
 
55
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
56
$aMax</font>
57
 
58
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
59
0</font>
60
</td><td>End X-value</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
$aFilled</font>
64
 
65
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
66
LP_AREA_NOT_FILLED</font>
67
</td><td>Fill area or not (true/false)</td></tr>
68
 
69
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
70
$aColor</font>
71
 
72
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
73
"gray9"</font>
74
</td><td>Color of fill</td></tr>
75
 
76
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
77
$aBorder</font>
78
 
79
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
80
LP_AREA_BORDER</font>
81
</td><td>Use a border (true/false)</td></tr>
82
</table>
83
 
84
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Create a vertical colored area under the line between two X-values and to the top of the line.
85
<p>
86
Predefined values for $aFilled are:<br>
87
LP_AREA_FILLED<br>
88
LP_AREA_NOT_FILLED<br>
89
&nbsp;<br>
90
 
91
<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">
92
$lineplot-&gt;AddArea(2,5,LP_AREA_FILLED,"indianred1");</font>
93
</span><br>
94
<p>
95
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_LINEPLOT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
96
function&nbsp;LinePlot(&amp;$datay,$datax)</font>
97
</b></div></a></span>
98
 
99
<span style='font-family:arial;font-size:90%;'><i>Public Constructor for LinePlot
100
</i></span><p>
101
 
102
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
103
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
104
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
105
&amp;$datay</font>
106
 
107
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Y-data</td></tr>
108
 
109
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
110
$datax</font>
111
 
112
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
113
false</font>
114
</td><td>X-data</td></tr>
115
</table>
116
 
117
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Create a new LinePlot which later can be added to the graph with the Graph::Add() or Graph::AddY2() method.
118
<p>
119
A plot can be specified with either only Y-values or both Y-and X-values. If both X and Y values are specified they should have the same number of elements.&nbsp;<br>
120
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Graph.html#_GRAPH_ADD">Graph::Add</a> and <a href="Graph.html#_GRAPH_ADDY2">Graph::AddY2</a>
121
<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">
122
 
123
</span><br>
124
<p>
125
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_SETBARCENTER"><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
function&nbsp;SetBarCenter($aFlag)</font>
127
</b></div></a></span>
128
129
 
130
131
 
132
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
133
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
134
$aFlag</font>
135
136
 
137
true</font>
138
</td><td>TRUE = Align line points to center of bars</td></tr>
139
</table>
140
141
 
142
<p>
143
This method is only to be used in the case where line and bar plots are combined. Any other use is undefined.&nbsp;<br>
144
145
 
146
$ydata&nbsp;=&nbsp;array(12,15,22,19,5);
<br />$graph&nbsp;=&nbsp;new&nbsp;Graph(400,200);
<br />$graph-&gt;SetScale("textlin");
<br />$line&nbsp;=&nbsp;new&nbsp;LinePlot($ydata);
<br />$line-&gt;SetBarCenter();
<br />$bar&nbsp;=&nbsp;new&nbsp;BarPlot($ydata);
<br />$graph-&gt;Add($bar);
<br />$graph-&gt;Add($line);
<br /></font>
147
</span><br>
148
<p>
149
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_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">
150
function&nbsp;SetColor($aColor)</font>
151
</b></div></a></span>
152
153
<span style='font-family:arial;font-size:90%;'><i>Set color for the line plot.</i></span><p>
154
155
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
156
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
157
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
158
$aColor</font>
159
160
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color</td></tr>
161
 
162
163
 
164
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
$lp&nbsp;=&nbsp;new&nbsp;LinePlot($ydata);
<br />
<br />//&nbsp;Set&nbsp;full&nbsp;blue
<br />$lp-&gt;SetColor('#0000FF');</font>
167
</span><br>
168
 
169
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_SETFASTSTROKE"><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;SetFastStroke($aFlg)</font>
171
 
172
173
 
174
175
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
176
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
177
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
178
$aFlg</font>
179
180
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
181
true</font>
182
</td><td>TRUE=Use fast stroke</td></tr>
183
</table>
184
 
185
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Use Fast version of Stroke(). This is useful for line plots which have many thousand points. This method is a lot faster than the usual Stroke() but also have a lot less functionality and puts restriction on the complexity of the line. The lines can have no plotmarks, must be solid and have a line width of 1&nbsp;<br>
186
 
187
<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">
188
$lineplot-&gt;SetFastStroke()</font>
189
</span><br>
190
<p>
191
 
192
function&nbsp;SetFillColor($aColor,$aFilled)</font>
193
</b></div></a></span>
194
195
<span style='font-family:arial;font-size:90%;'><i>Specify fill color</i></span><p>
196
 
197
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
198
 
199
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
200
$aColor</font>
201
202
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Color</td></tr>
203
204
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
205
$aFilled</font>
206
 
207
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
208
 
209
</td><td>Flag. Filled or not</td></tr>
210
</table>
211
212
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify that a lineplot should be filled as well as the fill color.&nbsp;<br>
213
 
214
<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">
215
 
216
</span><br>
217
<p>
218
 
219
function&nbsp;SetFillFromYMin($f)</font>
220
</b></div></a></span>
221
222
<span style='font-family:arial;font-size:90%;'><i>Fill line not from 0 but from the minimum Y value</i></span><p>
223
 
224
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
225
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
226
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
227
$f</font>
228
229
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
230
true</font>
231
</td><td>TRUE=fill from minimum</td></tr>
232
</table>
233
234
 
235
236
 
237
$lineplot-&gt;SetFillFromYMin();
<br /></font>
238
</span><br>
239
<p>
240
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_SETFILLGRADIENT"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
241
 
242
</b></div></a></span>
243
244
<span style='font-family:arial;font-size:90%;'><i>Specify a gradient fill for the line plot</i></span><p>
245
246
 
247
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
248
 
249
$aFromColor</font>
250
251
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Start color</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
$aToColor</font>
255
256
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>End color</td></tr>
257
 
258
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
259
 
260
261
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
262
100</font>
263
</td><td>Number of colors to use in transition</td></tr>
264
 
265
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
266
 
267
268
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
269
 
270
</td><td>TRUE=Enable gradient fill</td></tr>
271
 
272
273
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Specify a gradient fill for the line plot. Currently only vertical gradient fill is supported, i.e. the transiiton from color 1 to color 2 is vertical.
274
 
275
276
<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">
277
$p1&nbsp;=&nbsp;new&nbsp;LinePlot($datay);
<br />$p1-&gt;SetFillGradient('white','darkgreen');
<br /></font>
278
 
279
<p>
280
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_SETSTEPSTYLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
281
 
282
</b></div></a></span>
283
284
<span style='font-family:arial;font-size:90%;'><i>Use step style for line graph.</i></span><p>
285
286
 
287
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
288
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
289
 
290
291
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
292
true</font>
293
</td><td>Flag. true to use step style.</td></tr>
294
</table>
295
296
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>If the step style is enabled then each point will be connected not with a straight line between the points but with one horizontal and one vertical line. This makes the graph look like a stair where the next data point indicates if the stair is going up or down.
297
&nbsp;<br>
298
299
 
300
$lp-&gt;SetStepStyle();
<br /></font>
301
 
302
<p>
303
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEPLOT_SETSTYLE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
304
function&nbsp;SetStyle($aStyle)</font>
305
</b></div></a></span>
306
 
307
<span style='font-family:arial;font-size:90%;'><i>Specify line style.</i></span><p>
308
309
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
310
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
311
 
312
$aStyle</font>
313
314
 
315
</table>
316
317
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Linestyle for lines. Valid linestyles are:<br>
318
'solid', 'dotted', 'dashed'
319
<p>
320
The default line style is 'solid'
321
&nbsp;<br>
322
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="Image.html#_IMAGE_SETLINESTYLE">Image::SetLineStyle</a>
323
 
324
$lp-&gt;SetStyle('dotted');
<br /></font>
325
 
326
<p> <hr> <p>