1 | <?php |
||
27 | class Axis implements ComparableInterface |
||
28 | { |
||
29 | const AXIS_X = 'x'; |
||
30 | const AXIS_Y = 'y'; |
||
31 | |||
32 | const TICK_MARK_NONE = 'none'; |
||
33 | const TICK_MARK_CROSS = 'cross'; |
||
34 | const TICK_MARK_INSIDE = 'in'; |
||
35 | const TICK_MARK_OUTSIDE = 'out'; |
||
36 | |||
37 | /** |
||
38 | * Title |
||
39 | * |
||
40 | * @var string |
||
41 | */ |
||
42 | private $title = 'Axis Title'; |
||
43 | |||
44 | /** |
||
45 | * Format code |
||
46 | * |
||
47 | * @var string |
||
48 | */ |
||
49 | private $formatCode = ''; |
||
50 | |||
51 | /** |
||
52 | * Font |
||
53 | * |
||
54 | * @var \PhpOffice\PhpPresentation\Style\Font |
||
55 | */ |
||
56 | private $font; |
||
57 | |||
58 | /** |
||
59 | * @var Gridlines |
||
60 | */ |
||
61 | protected $majorGridlines; |
||
62 | |||
63 | /** |
||
64 | * @var Gridlines |
||
65 | */ |
||
66 | protected $minorGridlines; |
||
67 | |||
68 | /** |
||
69 | * @var int |
||
70 | */ |
||
71 | protected $minBounds; |
||
72 | |||
73 | /** |
||
74 | * @var int |
||
75 | */ |
||
76 | protected $maxBounds; |
||
77 | |||
78 | /** |
||
79 | * @var string |
||
80 | */ |
||
81 | protected $minorTickMark = self::TICK_MARK_NONE; |
||
82 | |||
83 | /** |
||
84 | * @var string |
||
85 | */ |
||
86 | protected $majorTickMark = self::TICK_MARK_NONE; |
||
87 | |||
88 | /** |
||
89 | * @var float |
||
90 | */ |
||
91 | protected $minorUnit; |
||
92 | |||
93 | /** |
||
94 | * @var float |
||
95 | */ |
||
96 | protected $majorUnit; |
||
97 | |||
98 | /** |
||
99 | * @var Outline |
||
100 | */ |
||
101 | protected $outline; |
||
102 | |||
103 | /** |
||
104 | * Create a new \PhpOffice\PhpPresentation\Shape\Chart\Axis instance |
||
105 | * |
||
106 | * @param string $title Title |
||
107 | */ |
||
108 | 75 | public function __construct($title = 'Axis Title') |
|
114 | |||
115 | /** |
||
116 | * Get Title |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | 26 | public function getTitle() |
|
124 | |||
125 | /** |
||
126 | * Set Title |
||
127 | * |
||
128 | * @param string $value |
||
129 | * @return \PhpOffice\PhpPresentation\Shape\Chart\Axis |
||
130 | */ |
||
131 | 1 | public function setTitle($value = 'Axis Title') |
|
137 | |||
138 | /** |
||
139 | * Get font |
||
140 | * |
||
141 | * @return \PhpOffice\PhpPresentation\Style\Font |
||
142 | */ |
||
143 | 49 | public function getFont() |
|
147 | |||
148 | /** |
||
149 | * Set font |
||
150 | * |
||
151 | * @param \PhpOffice\PhpPresentation\Style\Font $pFont Font |
||
152 | * @throws \Exception |
||
153 | * @return \PhpOffice\PhpPresentation\Shape\RichText\Paragraph |
||
154 | */ |
||
155 | 1 | public function setFont(Font $pFont = null) |
|
160 | |||
161 | /** |
||
162 | * Get Format Code |
||
163 | * |
||
164 | * @return string |
||
165 | */ |
||
166 | 25 | public function getFormatCode() |
|
170 | |||
171 | /** |
||
172 | * Set Format Code |
||
173 | * |
||
174 | * @param string $value |
||
175 | * @return \PhpOffice\PhpPresentation\Shape\Chart\Axis |
||
176 | */ |
||
177 | 1 | public function setFormatCode($value = '') |
|
183 | |||
184 | /** |
||
185 | * @return int|null |
||
186 | */ |
||
187 | 48 | public function getMinBounds() |
|
191 | |||
192 | /** |
||
193 | * @param int|null $minBounds |
||
194 | * @return Axis |
||
195 | */ |
||
196 | 3 | public function setMinBounds($minBounds = null) |
|
201 | |||
202 | /** |
||
203 | * @return int|null |
||
204 | */ |
||
205 | 48 | public function getMaxBounds() |
|
209 | |||
210 | /** |
||
211 | * @param int|null $maxBounds |
||
212 | * @return Axis |
||
213 | */ |
||
214 | 3 | public function setMaxBounds($maxBounds = null) |
|
219 | |||
220 | /** |
||
221 | * @return Gridlines |
||
222 | */ |
||
223 | 49 | public function getMajorGridlines() |
|
227 | |||
228 | /** |
||
229 | * @param Gridlines $majorGridlines |
||
230 | * @return Axis |
||
231 | */ |
||
232 | 3 | public function setMajorGridlines(Gridlines $majorGridlines) |
|
237 | |||
238 | /** |
||
239 | * @return Gridlines |
||
240 | */ |
||
241 | 49 | public function getMinorGridlines() |
|
245 | |||
246 | /** |
||
247 | * @param Gridlines $minorGridlines |
||
248 | * @return Axis |
||
249 | */ |
||
250 | 3 | public function setMinorGridlines(Gridlines $minorGridlines) |
|
255 | |||
256 | /** |
||
257 | * @return string |
||
258 | */ |
||
259 | 25 | public function getMinorTickMark() |
|
263 | |||
264 | /** |
||
265 | * @param string $pTickMark |
||
266 | * @return Axis |
||
267 | */ |
||
268 | 2 | public function setMinorTickMark($pTickMark = self::TICK_MARK_NONE) |
|
273 | |||
274 | /** |
||
275 | * @return string |
||
276 | */ |
||
277 | 25 | public function getMajorTickMark() |
|
281 | |||
282 | /** |
||
283 | * @param string $pTickMark |
||
284 | * @return Axis |
||
285 | */ |
||
286 | 2 | public function setMajorTickMark($pTickMark = self::TICK_MARK_NONE) |
|
291 | |||
292 | /** |
||
293 | * @return float |
||
294 | */ |
||
295 | 25 | public function getMinorUnit() |
|
299 | |||
300 | /** |
||
301 | * @param float $pUnit |
||
302 | * @return Axis |
||
303 | */ |
||
304 | 2 | public function setMinorUnit($pUnit = null) |
|
309 | |||
310 | /** |
||
311 | * @return float |
||
312 | */ |
||
313 | 25 | public function getMajorUnit() |
|
317 | |||
318 | /** |
||
319 | * @param float $pUnit |
||
320 | * @return Axis |
||
321 | */ |
||
322 | 2 | public function setMajorUnit($pUnit = null) |
|
327 | |||
328 | /** |
||
329 | * @return Outline |
||
330 | */ |
||
331 | 24 | public function getOutline() |
|
335 | |||
336 | /** |
||
337 | * @param Outline $outline |
||
338 | * @return Axis |
||
339 | */ |
||
340 | public function setOutline($outline) |
||
345 | |||
346 | /** |
||
347 | * Get hash code |
||
348 | * |
||
349 | * @return string Hash code |
||
350 | */ |
||
351 | 54 | public function getHashCode() |
|
355 | |||
356 | /** |
||
357 | * Hash index |
||
358 | * |
||
359 | * @var string |
||
360 | */ |
||
361 | private $hashIndex; |
||
362 | |||
363 | /** |
||
364 | * Get hash index |
||
365 | * |
||
366 | * Note that this index may vary during script execution! Only reliable moment is |
||
367 | * while doing a write of a workbook and when changes are not allowed. |
||
368 | * |
||
369 | * @return string Hash index |
||
370 | */ |
||
371 | 1 | public function getHashIndex() |
|
375 | |||
376 | /** |
||
377 | * Set hash index |
||
378 | * |
||
379 | * Note that this index may vary during script execution! Only reliable moment is |
||
380 | * while doing a write of a workbook and when changes are not allowed. |
||
381 | * |
||
382 | * @param string $value Hash index |
||
383 | */ |
||
384 | 1 | public function setHashIndex($value) |
|
389 | } |
||
390 |