1 | <?php |
||
15 | class AxisPrototype |
||
16 | { |
||
17 | public $scale = null; |
||
18 | public $img = null; |
||
19 | public $hide = false; |
||
20 | public $hide_labels = false; |
||
21 | public $title = null; |
||
22 | public $font_family = FF_DEFAULT; |
||
23 | public $font_style = FS_NORMAL; |
||
24 | public $font_size = 8; |
||
25 | public $label_angle = 0; |
||
26 | public $tick_step = 1; |
||
27 | public $pos = false; |
||
28 | public $ticks_label = array(); |
||
29 | |||
30 | protected $weight = 1; |
||
31 | protected $color = array(0, 0, 0); |
||
32 | protected $label_color = array(0, 0, 0); |
||
33 | protected $ticks_label_colors = null; |
||
34 | protected $show_first_label = true; |
||
35 | protected $show_last_label = true; |
||
36 | protected $label_step = 1; // Used by a text axis to specify what multiple of major steps |
||
37 | // should be labeled. |
||
38 | protected $labelPos = 0; // Which side of the axis should the labels be? |
||
39 | protected $title_adjust; |
||
40 | protected $title_margin; |
||
41 | protected $title_side = SIDE_LEFT; |
||
42 | protected $tick_label_margin = 5; |
||
43 | protected $label_halign = ''; |
||
44 | protected $label_valign = ''; |
||
45 | protected $label_para_align = 'left'; |
||
46 | protected $hide_line = false; |
||
47 | protected $iDeltaAbsPos = 0; |
||
48 | |||
49 | public function __construct($img, $aScale, $color = array(0, 0, 0)) |
||
71 | |||
72 | public function SetLabelFormat($aFormStr) |
||
76 | |||
77 | public function SetLabelFormatString($aFormStr, $aDate = false) |
||
81 | |||
82 | public function SetLabelFormatCallback($aFuncName) |
||
86 | |||
87 | public function SetLabelAlign($aHAlign, $aVAlign = 'top', $aParagraphAlign = 'left') |
||
93 | |||
94 | // Don't display the first label |
||
95 | public function HideFirstTickLabel($aShow = false) |
||
99 | |||
100 | public function HideLastTickLabel($aShow = false) |
||
104 | |||
105 | // Manually specify the major and (optional) minor tick position and labels |
||
106 | public function SetTickPositions($aMajPos, $aMinPos = null, $aLabels = null) |
||
110 | |||
111 | // Manually specify major tick positions and optional labels |
||
112 | public function SetMajTickPositions($aMajPos, $aLabels = null) |
||
116 | |||
117 | // Hide minor or major tick marks |
||
118 | public function HideTicks($aHideMinor = true, $aHideMajor = true) |
||
123 | |||
124 | // Hide zero label |
||
125 | public function HideZeroLabel($aFlag = true) |
||
129 | |||
130 | public function HideFirstLastLabel() |
||
142 | |||
143 | // Hide the axis |
||
144 | public function Hide($aHide = true) |
||
148 | |||
149 | // Hide the actual axis-line, but still print the labels |
||
150 | public function HideLine($aHide = true) |
||
154 | |||
155 | public function HideLabels($aHide = true) |
||
159 | |||
160 | // Weight of axis |
||
161 | public function SetWeight($aWeight) |
||
165 | |||
166 | // Axis color |
||
167 | public function SetColor($aColor, $aLabelColor = false) |
||
176 | |||
177 | // Title on axis |
||
178 | public function SetTitle($aTitle, $aAdjustAlign = 'high') |
||
183 | |||
184 | // Specify distance from the axis |
||
185 | public function SetTitleMargin($aMargin) |
||
189 | |||
190 | // Which side of the axis should the axis title be? |
||
191 | public function SetTitleSide($aSideOfAxis) |
||
195 | |||
196 | public function SetTickSide($aDir) |
||
200 | |||
201 | public function SetTickSize($aMajSize, $aMinSize = 3) |
||
205 | |||
206 | // Specify text labels for the ticks. One label for each data point |
||
207 | public function SetTickLabels($aLabelArray, $aLabelColorArray = null) |
||
212 | |||
213 | public function SetLabelMargin($aMargin) |
||
217 | |||
218 | // Specify that every $step of the ticks should be displayed starting |
||
219 | // at $start |
||
220 | public function SetTextTickInterval($aStep, $aStart = 0) |
||
225 | |||
226 | // Specify that every $step tick mark should have a label |
||
227 | // should be displayed starting |
||
228 | public function SetTextLabelInterval($aStep) |
||
235 | |||
236 | public function SetLabelSide($aSidePos) |
||
240 | |||
241 | // Set the font |
||
242 | public function SetFont($aFamily, $aStyle = FS_NORMAL, $aSize = 10) |
||
248 | |||
249 | // Position for axis line on the "other" scale |
||
250 | public function SetPos($aPosOnOtherScale) |
||
254 | |||
255 | // Set the position of the axis to be X-pixels delta to the right |
||
256 | // of the max X-position (used to position the multiple Y-axis) |
||
257 | public function SetPosAbsDelta($aDelta) |
||
261 | |||
262 | // Specify the angle for the tick labels |
||
263 | public function SetLabelAngle($aAngle) |
||
267 | } // Class |
||
268 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.