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_CANVASSCALE"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>CanvasScale</b></div>
9
<i>(Defined in: jpgraph_canvtools.php : 24)</i><table border=1><tr><td>&nbsp;<a href="CanvasScale.html" style="font-family:arial;font-weight:bold;color:darkblue;">CanvasScale</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="CanvasScale.html#_CANVASSCALE_CANVASSCALE">CanvasScale()</a>&nbsp;<br>
10
&nbsp;<a href="CanvasScale.html#_CANVASSCALE_SET">Set()</a>&nbsp;<br>
11
&nbsp;<a href="CanvasScale.html#_CANVASSCALE_TRANSLATE">Translate()</a>&nbsp;<br>
12
&nbsp;<a href="CanvasScale.html#_CANVASSCALE_TRANSLATEX">TranslateX()</a>&nbsp;<br>
13
&nbsp;<a href="CanvasScale.html#_CANVASSCALE_TRANSLATEY">TranslateY()</a>&nbsp;<br>
14
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>This class defines a scale which is meant to be used with canvas graphs to make it possibles to pecify a more convinient scale compared to absoilute pixels coordinates.
15
<br>
16
This will also let you scale the canvas without any coordinate changes. <p> &nbsp;
17
<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
18
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASSCALE_CANVASSCALE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
19
function&nbsp;CanvasScale(&amp;$graph,$xmin,$xmax,$ymin,$ymax)</font>
20
</b></div></a></span>
21
 
22
<span style='font-family:arial;font-size:90%;'><i>Define a scale for canvas  graphs</i></span><p>
23
 
24
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
25
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
26
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
27
&amp;$graph</font>
28
 
29
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Canvas graph</td></tr>
30
 
31
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
32
$xmin</font>
33
 
34
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
35
0</font>
36
</td><td>Min X-value for scale</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
$xmax</font>
40
 
41
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
42
10</font>
43
</td><td>Max X-value for scale</td></tr>
44
 
45
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
46
$ymin</font>
47
 
48
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
49
0</font>
50
</td><td>Min Y-value for scale</td></tr>
51
 
52
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
53
$ymax</font>
54
 
55
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
56
10</font>
57
</td><td>Max Y-value for scale</td></tr>
58
</table>
59
 
60
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Define a scale for canvas graphs. Note the scale values is optionally in this call. The may be later set witha  call to the Set() method.&nbsp;<br>
61
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="CanvasScale.html#_CANVASSCALE_SET">CanvasScale::Set</a><p>
62
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASSCALE_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">
63
function&nbsp;Set($xmin,$xmax,$ymin,$ymax)</font>
64
</b></div></a></span>
65
 
66
<span style='font-family:arial;font-size:90%;'><i>Specify scale to use</i></span><p>
67
 
68
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
69
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
70
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
71
$xmin</font>
72
 
73
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
74
0</font>
75
</td><td>Min X value</td></tr>
76
 
77
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
78
$xmax</font>
79
 
80
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
81
10</font>
82
</td><td>Max X-value</td></tr>
83
 
84
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
85
$ymin</font>
86
 
87
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
88
0</font>
89
</td><td>Min Y-value</td></tr>
90
 
91
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
92
$ymax</font>
93
 
94
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
95
10</font>
96
</td><td>Max Y-value</td></tr>
97
</table>
98
 
99
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>SPecify min/max values for scale.&nbsp;<br>
100
 
101
<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">
102
//&nbsp;Setup&nbsp;a&nbsp;basic&nbsp;canvas&nbsp;we&nbsp;can&nbsp;work&nbsp;
<br />$g&nbsp;=&nbsp;new&nbsp;CanvasGraph(400,200,'auto');
<br />$g-&gt;SetMargin(5,11,6,11);
<br />$g-&gt;SetShadow();
<br />$g-&gt;SetMarginColor("teal");
<br />
<br />//&nbsp;We&nbsp;need&nbsp;to&nbsp;stroke&nbsp;the&nbsp;plotarea&nbsp;and&nbsp;margin&nbsp;before&nbsp;we&nbsp;add&nbsp;the
<br />//&nbsp;text&nbsp;since&nbsp;we&nbsp;otherwise&nbsp;would&nbsp;overwrite&nbsp;the&nbsp;text.
<br />$g-&gt;InitFrame();
<br />
<br />//&nbsp;Create&nbsp;a&nbsp;new&nbsp;scale
<br />$scale&nbsp;=&nbsp;new&nbsp;CanvasScale($g);
<br />$scale-&gt;Set(0,$xmax,0,$ymax);
<br /></font>
103
</span><br>
104
<p>
105
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASSCALE_TRANSLATE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
106
function&nbsp;Translate($x,$y)</font>
107
</b></div></a></span>
108
109
<span style='font-family:arial;font-size:90%;'><i>Translate a point to absolute screen coordinates</i></span><p>
110
111
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
112
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
113
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
114
$x</font>
115
116
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X-value</td></tr>
117
118
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
119
$y</font>
120
121
 
122
</table>
123
 
124
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Translate a point to absolute screen coordinates&nbsp;<br>
125
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="CanvasScale.html#_CANVASSCALE_TRANSLATEX">CanvasScale::TranslateX</a> and <a href="CanvasScale.html#_CANVASSCALE_TRANSLATEY">CanvasScale::TranslateY</a>
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
list($xt,$yt)&nbsp;=&nbsp;$scale-&gt;Translate($x,$y);
<br />$graph-&gt;img-&gt;Point($xt,$yt);</font>
128
 
129
<p>
130
 
131
function&nbsp;TranslateX($x)</font>
132
</b></div></a></span>
133
 
134
<span style='font-family:arial;font-size:90%;'><i>Translate X-coordinate</i></span><p>
135
136
 
137
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
138
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
139
$x</font>
140
141
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>X-value</td></tr>
142
</table>
143
144
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Translate X-value into absolute screen coordinates&nbsp;<br>
145
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="CanvasScale.html#_CANVASSCALE_TRANSLATE">CanvasScale::Translate</a><p>
146
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_CANVASSCALE_TRANSLATEY"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
147
 
148
</b></div></a></span>
149
 
150
<span style='font-family:arial;font-size:90%;'><i>Translate Y-value to absolute screen coordinates</i></span><p>
151
152
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
153
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
154
 
155
$y</font>
156
157
 
158
</table>
159
160
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Translate Y-value to absolute screen coordinates&nbsp;<br>
161
 &nbsp; <div style="font-weight:bold;font-family:arial;font-size:85%;">See also</div><a href="CanvasScale.html#_CANVASSCALE_TRANSLATE">CanvasScale::Translate</a><p> <hr> <p>