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_LINEARSCALE"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>LinearScale</b></div>
9
<i>(Defined in: jpgraph.php : 4429)</i><table border=1><tr><td>&nbsp;<a href="LinearScale.html" style="font-family:arial;font-weight:bold;color:darkblue;">LinearScale</a>&nbsp;</td></tr><tr><td valign=top>&nbsp;<a href="LinearScale.html#_LINEARSCALE_SETAUTOMAX">SetAutoMax()</a>&nbsp;<br>
10
&nbsp;<a href="LinearScale.html#_LINEARSCALE_SETAUTOMIN">SetAutoMin()</a>&nbsp;<br>
11
&nbsp;<a href="LinearScale.html#_LINEARSCALE_SETAUTOTICKS">SetAutoTicks()</a>&nbsp;<br>
12
&nbsp;<a href="LinearScale.html#_LINEARSCALE_SETGRACE">SetGrace()</a>&nbsp;<br>
13
</td></tr></table>&nbsp;<p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>This class is the main scale class and implements the linear and integer scale for the axis. <p> &nbsp;
14
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="Axis.html">Axis</a> and <a href="LogScale.html">LogScale</a> <p> &nbsp;<hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
15
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEARSCALE_SETAUTOMAX"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
16
function&nbsp;SetAutoMax($aMax)</font>
17
</b></div></a></span>
18
 
19
<span style='font-family:arial;font-size:90%;'><i>Fix the maximum value for a scale</i></span><p>
20
 
21
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
22
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
23
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
24
$aMax</font>
25
 
26
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Maximum value</td></tr>
27
</table>
28
 
29
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Fix a maximum value for a scale eventhough autoscaling is used for the min value.&nbsp;<br>
30
 
31
<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">
32
//&nbsp;For&nbsp;a&nbsp;negative&nbsp;scale&nbsp;we&nbsp;might&nbsp;want&nbsp;to&nbsp;make&nbsp;sure&nbsp;it
<br />//&nbsp;always&nbsp;start&nbsp;at&nbsp;the&nbsp;top&nbsp;from&nbsp;0
<br />$graph-&gt;y2scale-&gt;SetAutoMax(0);</font>
33
</span><br>
34
<p>
35
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEARSCALE_SETAUTOMIN"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
36
function&nbsp;SetAutoMin($aMin)</font>
37
</b></div></a></span>
38
39
<span style='font-family:arial;font-size:90%;'><i>Set the minimum data value when the autoscaling is used.</i></span><p>
40
 
41
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
42
 
43
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
44
$aMin</font>
45
46
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Min value</td></tr>
47
 
48
49
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set the minimum data value when the autoscaling is used. Usefull if you want a fix minimum (like 0) but automtic maximum value.&nbsp;<br>
50
 
51
<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">
52
 
53
</span><br>
54
<p>
55
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEARSCALE_SETAUTOTICKS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
56
function&nbsp;SetAutoTicks($aFlag)</font>
57
</b></div></a></span>
58
59
<span style='font-family:arial;font-size:90%;'><i>Determine ticks automtically with manual scale</i></span><p>
60
61
 
62
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
63
 
64
$aFlag</font>
65
66
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
67
true</font>
68
 
69
</table>
70
71
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>This is used in conjunction when a manual scale is specified. In normall cases one has also to specify major and minor tick steps.
72
<p>
73
 
74
75
$graph->SetScale("textlin",0,70);<br>
76
$graph->yscale->ticks->Set(10,2);
77
 
78
However by instead using
79
<p>
80
$graph->SetScale("textlin",0,70);<br>
81
$graph->yscale->SetAutoTicks();
82
<p>
83
The major and minor ticks are determined automatically.
84
<p>
85
The thing you have to be aware of is that the specified min and max values might be slightly modified so that the end/beginning of the scale will fall on a major tick step.
86
<p>
87
By default the auto ticks are off.
88
89
90
&nbsp;<br>
91
 
92
 
93
//&nbsp;Manually&nbsp;set&nbsp;Y-scale&nbsp;min=30,&nbsp;max=90
<br />$graph-&gt;SetScale('textlin',30,90);
<br />
<br />//&nbsp;Let&nbsp;JpGraph&nbsp;figure&nbsp;out&nbsp;suitable&nbsp;tick&nbsp;marks
<br />$graph-&gt;yscale-&gt;SetAutoTicks();
<br />
<br /></font>
94
</span><br>
95
<p>
96
<p>&nbsp; <p> &nbsp; <span style='font-size:110%;'><a name="_LINEARSCALE_SETGRACE"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
97
function&nbsp;SetGrace($aGraceTop,$aGraceBottom)</font>
98
</b></div></a></span>
99
100
<span style='font-family:arial;font-size:90%;'><i>// Specify scale "grace" value (top and bottom)</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
$aGraceTop</font>
106
107
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'>&nbsp;</td><td>Top grace value</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
 
111
112
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
113
0</font>
114
</td><td>Bottom grace value</td></tr>
115
 
116
117
 
118
<p>
119
By specifyin the grace you get added space. The value specified is interpretated as extra percentage of the total scale range.
120
 
121
For example if the scale range (without grace) is (0,100) and you add 10% top grace (with SetGrace(10)) the modified scale will be (0,110) and if you use a 100% top grace the scale will be (0,200) and so on.&nbsp;<br>
122
123
<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">
124
$graph-&gt;xaxis-&gt;scale-&gt;SetGrace(50);</font>
125
 
126
<p> <hr> <p>