| 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_LINEARTICKS"><div style="background-color:yellow;font-family:courier new;"></a>CLASS <b>LinearTicks</b> EXTENDS <a href="Ticks .html#_C_TICKS " style="font-face:arial;font-weight:bold;">Ticks </a></div>
|
|
|
9 |
<i>(Defined in: jpgraph.php : 4075)</i><table border=1><tr><td> <a href="LinearTicks.html" style="font-family:arial;font-weight:bold;color:darkblue;">LinearTicks</a> </td><td> <a href="Ticks .html" style="font-family:arial;font-weight:bold;color:darkblue;">Ticks </a> </td></tr><tr><td valign=top> <a href="LinearTicks.html#_LINEARTICKS_ADJUSTFORDST">AdjustForDST()</a> <br>
|
|
|
10 |
<a href="LinearTicks.html#_LINEARTICKS_GETMAJOR">GetMajor()</a> <br>
|
|
|
11 |
<a href="LinearTicks.html#_LINEARTICKS_GETMINOR">GetMinor()</a> <br>
|
|
|
12 |
<a href="LinearTicks.html#_LINEARTICKS_SET">Set()</a> <br>
|
|
|
13 |
<a href="LinearTicks.html#_LINEARTICKS_SETMAJTICKPOSITIONS">SetMajTickPositions()</a> <br>
|
|
|
14 |
<a href="LinearTicks.html#_LINEARTICKS_SETTEXTLABELSTART">SetTextLabelStart()</a> <br>
|
|
|
15 |
<a href="LinearTicks.html#_LINEARTICKS_SETTICKPOSITIONS">SetTickPositions()</a> <br>
|
|
|
16 |
</td><td valign=top> </td></tr></table> <p><div style="font-weight:bold;font-family:arial;font-size:100%;">Class usage and Overview</div>Internal class that handles the drawing and formatting of the tick marks on each axis. This class is accessed through it'sinstance variable in the scale, e.g.
|
|
|
17 |
<p>
|
|
|
18 |
$graph->xaxis->scale->ticks->Set(20,10);
|
|
|
19 |
<p>
|
|
|
20 |
<b>Note:</b> When you manually specify a scale you must also specify the major/minor tick intervall. <p>
|
|
|
21 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">See also related classes:</div><a href="LinearScale.html">LinearScale</a> and <a href="LogScale.html">LogScale</a> <p> <hr><span style="font-family:arial;font-size:120%;font-weight:bold;">Class Methods</span><hr><p>
|
|
|
22 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_ADJUSTFORDST"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
23 |
function AdjustForDST($aFlg)</font>
|
|
|
24 |
</b></div></a></span>
|
|
|
25 |
|
|
|
26 |
<span style='font-family:arial;font-size:90%;'><i>// For a normal linear type of scale the major ticks will always be multiples// of the minor ticks. In order to avoid any rounding issues the major ticks are// defined as every "step" minor ticks and not calculated separately</i></span><p>
|
|
|
27 |
|
|
|
28 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
29 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
30 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
31 |
$aFlg</font>
|
|
|
32 |
|
|
|
33 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
34 |
true</font>
|
|
|
35 |
</td><td>No description available</td></tr>
|
|
|
36 |
</table>
|
|
|
37 |
|
|
|
38 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>No description available.<p>
|
|
|
39 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_GETMAJOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
40 |
function GetMajor()</font>
|
|
|
41 |
</b></div></a></span>
|
|
|
42 |
|
|
|
43 |
<span style='font-family:arial;font-size:90%;'><i>Return major step size in world coordinates</i></span><p>
|
|
|
44 |
<br>
|
|
|
45 |
|
|
|
46 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Return major step size in world coordinates <br>
|
|
|
47 |
|
|
|
48 |
<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">
|
|
|
49 |
$majintervall = $graph->xaxis->scale->ticks->Getmajor();</font>
|
|
|
50 |
</span><br>
|
|
|
51 |
<p>
|
|
|
52 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_GETMINOR"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
53 |
function GetMinor()</font>
|
|
|
54 |
</b></div></a></span>
|
|
|
55 |
|
|
|
56 |
<span style='font-family:arial;font-size:90%;'><i>// Return minor step size in world coordinates</i></span><p>
|
|
|
57 |
<br>
|
|
|
58 |
|
|
|
59 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Return minor step size in world coordinates. <br>
|
|
|
60 |
|
|
|
61 |
<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">
|
|
|
62 |
$majintervall = $graph->xaxis->scale->ticks->Getmajor();</font>
|
|
|
63 |
</span><br>
|
|
|
64 |
<p>
|
|
|
65 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_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">
|
|
|
66 |
function Set($aMajStep,$aMinStep)</font>
|
|
|
67 |
</b></div></a></span>
|
|
|
68 |
|
|
|
69 |
<span style='font-family:arial;font-size:90%;'><i>// Set Minor and Major ticks (in world coordinates)</i></span><p>
|
|
|
70 |
|
|
|
71 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
72 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
73 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
74 |
$aMajStep</font>
|
|
|
75 |
|
|
|
76 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>Distance between major tick marks</td></tr>
|
|
|
77 |
|
|
|
78 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
79 |
$aMinStep</font>
|
|
|
80 |
|
|
|
81 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
82 |
false</font>
|
|
|
83 |
</td><td>Distance between minor tick marks</td></tr>
|
|
|
84 |
</table>
|
|
|
85 |
|
|
|
86 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Set Minor and Major tick intervall (in world coordinates) <br>
|
|
|
87 |
|
|
|
88 |
<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">
|
|
|
89 |
$graph->yaxis->scale->ticks->Set(40,20);</font>
|
|
|
90 |
</span><br>
|
|
|
91 |
<p>
|
|
|
92 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_SETMAJTICKPOSITIONS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
93 |
function SetMajTickPositions($aMajPos,$aLabels)</font>
|
|
|
94 |
</b></div></a></span>
|
|
|
95 |
|
|
|
96 |
<span style='font-family:arial;font-size:90%;'><i>//(" Minor or major step size is 0. Check that you haven't got an accidental SetTextTicks(0) in your code. If this is not the case you might have stumbled upon a bug in JpGraph. Please report this and if possible include the data that caused the problem."</i></span><p>
|
|
|
97 |
|
|
|
98 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
99 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
100 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
101 |
$aMajPos</font>
|
|
|
102 |
|
|
|
103 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>No description available</td></tr>
|
|
|
104 |
|
|
|
105 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
106 |
$aLabels</font>
|
|
|
107 |
|
|
|
108 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
109 |
NULL</font>
|
|
|
110 |
</td><td>No description available</td></tr>
|
|
|
111 |
</table>
|
|
|
112 |
|
|
|
113 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>No description available.<p>
|
|
|
114 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_SETTEXTLABELSTART"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
115 |
function SetTextLabelStart($aTextLabelOff)</font>
|
|
|
116 |
</b></div></a></span>
|
|
|
117 |
|
|
|
118 |
<span style='font-family:arial;font-size:90%;'><i>Which tick label should we start with?</i></span><p>
|
|
|
119 |
|
|
|
120 |
<table cellspacing=0 style='border:black solid 1pt;' width=100%>
|
|
|
121 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
122 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
123 |
$aTextLabelOff</font>
|
|
|
124 |
|
|
|
125 |
</td><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'> </td><td>The number thaht the automatic textscale should start with.</td></tr>
|
|
|
126 |
</table>
|
|
|
127 |
|
|
|
128 |
<div style="font-weight:bold;font-family:arial;font-size:85%;">Description</div>Normally text labels start at 0. However, automtic text labels can be started with an arbitrary number as specified with the argument to this method.
|
|
|
129 |
<br>
|
|
|
130 |
|
|
|
131 |
<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">
|
|
|
132 |
$graph->xaxis->scale->ticks->SetTextLabelStart(10);
<br /></font>
|
|
|
133 |
</span><br>
|
|
|
134 |
<p>
|
|
|
135 |
<p> <p> <span style='font-size:110%;'><a name="_LINEARTICKS_SETTICKPOSITIONS"><div style="border-top:solid black 2pt;background-color:lightblue;font-family:courier new;font-size:90%;font-weight:bold;"><b><font color="#000000">
|
|
|
136 |
function SetTickPositions($aMajPos,$aMinPos,$aLabels)</font>
|
|
|
137 |
</b></div></a></span>
|
|
|
138 |
|
|
|
139 |
|
|
|
140 |
|
|
|
141 |
|
|
|
142 |
<tr><th width=25%>Argument</th><th width=15%>Default</th><th width=60%>Description</th></tr>
|
|
|
143 |
<tr><td style='border-right:black solid 1pt;font-family:courier;font-size:90%;font-weight:bold;'><font color="#000000">
|
|
|
144 |
$aMajPos</font>
|
|
|
145 |
|
|
|
146 |
|
|
|
147 |
|
|
|
148 |
|
|
|
149 |
$aMinPos</font>
|
|
|
150 |
|
|
|
151 |
|
|
|
152 |
NULL</font>
|
|
|
153 |
</td><td>Array of minor positions</td></tr>
|
|
|
154 |
|
|
|
155 |
|
|
|
156 |
$aLabels</font>
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
NULL</font>
|
|
|
160 |
</td><td>Array of major label strings</td></tr>
|
|
|
161 |
</table>
|
|
|
162 |
|
|
|
163 |
|
|
|
164 |
|
|
|
165 |
|
|
|
166 |
$graph->xaxis->SetMajTickPositions($tickPositions,$tickLabels);</font>
|
|
|
167 |
</span><br>
|
|
|
168 |
<p> <hr> <p>
|