@@ -13,343 +13,343 @@ |
||
13 | 13 | */ |
14 | 14 | class GridLines implements ArraySerializableInterface, \JsonSerializable |
15 | 15 | { |
16 | - use ArraySerializable; |
|
17 | - |
|
18 | - /** |
|
19 | - * @var bool |
|
20 | - */ |
|
21 | - private $display; |
|
22 | - |
|
23 | - /** |
|
24 | - * @var string|string[] |
|
25 | - */ |
|
26 | - private $color; |
|
27 | - |
|
28 | - /** |
|
29 | - * @var float[] |
|
30 | - */ |
|
31 | - private $borderDash; |
|
32 | - |
|
33 | - /** |
|
34 | - * @var float |
|
35 | - */ |
|
36 | - private $borderDashOffset; |
|
37 | - |
|
38 | - /** |
|
39 | - * @var int|int[] |
|
40 | - */ |
|
41 | - private $lineWidth; |
|
42 | - |
|
43 | - /** |
|
44 | - * @var bool |
|
45 | - */ |
|
46 | - private $drawBorder; |
|
47 | - |
|
48 | - /** |
|
49 | - * @var bool |
|
50 | - */ |
|
51 | - private $drawOnChartArea; |
|
52 | - |
|
53 | - /** |
|
54 | - * @var bool |
|
55 | - */ |
|
56 | - private $drawTicks; |
|
57 | - |
|
58 | - /** |
|
59 | - * @var int |
|
60 | - */ |
|
61 | - private $tickMarkLength; |
|
62 | - |
|
63 | - /** |
|
64 | - * @var int |
|
65 | - */ |
|
66 | - private $zeroLineWidth; |
|
67 | - |
|
68 | - /** |
|
69 | - * @var string |
|
70 | - */ |
|
71 | - private $zeroLineColor; |
|
72 | - |
|
73 | - /** |
|
74 | - * @var bool |
|
75 | - */ |
|
76 | - private $offsetGridLines; |
|
77 | - |
|
78 | - /** |
|
79 | - * @return boolean |
|
80 | - */ |
|
81 | - public function isDisplay() |
|
82 | - { |
|
83 | - return $this->display; |
|
84 | - } |
|
85 | - |
|
86 | - /** |
|
87 | - * @param boolean $display |
|
88 | - * |
|
89 | - * @return $this |
|
90 | - */ |
|
91 | - public function setDisplay($display) |
|
92 | - { |
|
93 | - $this->display = $display; |
|
94 | - |
|
95 | - return $this; |
|
96 | - } |
|
97 | - |
|
98 | - /** |
|
99 | - * @return string|string[] |
|
100 | - */ |
|
101 | - public function getColor() |
|
102 | - { |
|
103 | - return $this->color; |
|
104 | - } |
|
105 | - |
|
106 | - /** |
|
107 | - * @param string|string[] $color |
|
108 | - * |
|
109 | - * @return $this |
|
110 | - */ |
|
111 | - public function setColor($color) |
|
112 | - { |
|
113 | - if (is_array($color)) { |
|
114 | - array_walk_recursive( |
|
115 | - $color, |
|
116 | - function (&$value) { |
|
117 | - $value = strval($value); |
|
118 | - } |
|
119 | - ); |
|
120 | - $this->color = $color; |
|
121 | - } else { |
|
122 | - $this->color = is_null($color) ? null : strval($color); |
|
123 | - } |
|
124 | - |
|
125 | - return $this; |
|
126 | - } |
|
127 | - |
|
128 | - /** |
|
129 | - * @return \float[] |
|
130 | - */ |
|
131 | - public function getBorderDash() |
|
132 | - { |
|
133 | - return $this->borderDash; |
|
134 | - } |
|
135 | - |
|
136 | - /** |
|
137 | - * @param \float[] $borderDash |
|
138 | - * |
|
139 | - * @return $this |
|
140 | - */ |
|
141 | - public function setBorderDash($borderDash) |
|
142 | - { |
|
143 | - if (is_array($borderDash)) { |
|
144 | - array_walk_recursive( |
|
145 | - $borderDash, |
|
146 | - function (&$value) { |
|
147 | - $value = floatval($value); |
|
148 | - } |
|
149 | - ); |
|
150 | - $this->borderDash = $borderDash; |
|
151 | - } |
|
152 | - |
|
153 | - return $this; |
|
154 | - } |
|
155 | - |
|
156 | - /** |
|
157 | - * @return float |
|
158 | - */ |
|
159 | - public function getBorderDashOffset() |
|
160 | - { |
|
161 | - return $this->borderDashOffset; |
|
162 | - } |
|
163 | - |
|
164 | - /** |
|
165 | - * @param float $borderDashOffset |
|
166 | - * |
|
167 | - * @return $this |
|
168 | - */ |
|
169 | - public function setBorderDashOffset($borderDashOffset) |
|
170 | - { |
|
171 | - $this->borderDashOffset = floatval($borderDashOffset); |
|
172 | - |
|
173 | - return $this; |
|
174 | - } |
|
175 | - |
|
176 | - /** |
|
177 | - * @return int|int[] |
|
178 | - */ |
|
179 | - public function getLineWidth() |
|
180 | - { |
|
181 | - return $this->lineWidth; |
|
182 | - } |
|
183 | - |
|
184 | - /** |
|
185 | - * @param int|int[] $lineWidth |
|
186 | - * |
|
187 | - * @return $this |
|
188 | - */ |
|
189 | - public function setLineWidth($lineWidth) |
|
190 | - { |
|
191 | - if (is_array($lineWidth)) { |
|
192 | - array_walk_recursive( |
|
193 | - $lineWidth, |
|
194 | - function (&$value) { |
|
195 | - $value = intval($value); |
|
196 | - } |
|
197 | - ); |
|
198 | - $this->lineWidth = $lineWidth; |
|
199 | - } else { |
|
200 | - $this->lineWidth = is_null($lineWidth) ? null : intval($lineWidth); |
|
201 | - } |
|
202 | - |
|
203 | - return $this; |
|
204 | - } |
|
205 | - |
|
206 | - /** |
|
207 | - * @return boolean |
|
208 | - */ |
|
209 | - public function isDrawBorder() |
|
210 | - { |
|
211 | - return $this->drawBorder; |
|
212 | - } |
|
213 | - |
|
214 | - /** |
|
215 | - * @param boolean $drawBorder |
|
216 | - * |
|
217 | - * @return $this |
|
218 | - */ |
|
219 | - public function setDrawBorder($drawBorder) |
|
220 | - { |
|
221 | - $this->drawBorder = boolval($drawBorder); |
|
222 | - |
|
223 | - return $this; |
|
224 | - } |
|
225 | - |
|
226 | - /** |
|
227 | - * @return boolean |
|
228 | - */ |
|
229 | - public function isDrawOnChartArea() |
|
230 | - { |
|
231 | - return $this->drawOnChartArea; |
|
232 | - } |
|
233 | - |
|
234 | - /** |
|
235 | - * @param boolean $drawOnChartArea |
|
236 | - * |
|
237 | - * @return $this |
|
238 | - */ |
|
239 | - public function setDrawOnChartArea($drawOnChartArea) |
|
240 | - { |
|
241 | - $this->drawOnChartArea = boolval($drawOnChartArea); |
|
242 | - |
|
243 | - return $this; |
|
244 | - } |
|
245 | - |
|
246 | - /** |
|
247 | - * @return boolean |
|
248 | - */ |
|
249 | - public function isDrawTicks() |
|
250 | - { |
|
251 | - return $this->drawTicks; |
|
252 | - } |
|
253 | - |
|
254 | - /** |
|
255 | - * @param boolean $drawTicks |
|
256 | - * |
|
257 | - * @return $this |
|
258 | - */ |
|
259 | - public function setDrawTicks($drawTicks) |
|
260 | - { |
|
261 | - $this->drawTicks = boolval($drawTicks); |
|
262 | - |
|
263 | - return $this; |
|
264 | - } |
|
265 | - |
|
266 | - /** |
|
267 | - * @return int |
|
268 | - */ |
|
269 | - public function getTickMarkLength() |
|
270 | - { |
|
271 | - return $this->tickMarkLength; |
|
272 | - } |
|
273 | - |
|
274 | - /** |
|
275 | - * @param int $tickMarkLength |
|
276 | - * |
|
277 | - * @return $this |
|
278 | - */ |
|
279 | - public function setTickMarkLength($tickMarkLength) |
|
280 | - { |
|
281 | - $this->tickMarkLength = intval($tickMarkLength); |
|
282 | - |
|
283 | - return $this; |
|
284 | - } |
|
285 | - |
|
286 | - /** |
|
287 | - * @return int |
|
288 | - */ |
|
289 | - public function getZeroLineWidth() |
|
290 | - { |
|
291 | - return $this->zeroLineWidth; |
|
292 | - } |
|
293 | - |
|
294 | - /** |
|
295 | - * @param int $zeroLineWidth |
|
296 | - * |
|
297 | - * @return $this |
|
298 | - */ |
|
299 | - public function setZeroLineWidth($zeroLineWidth) |
|
300 | - { |
|
301 | - $this->zeroLineWidth = intval($zeroLineWidth); |
|
302 | - |
|
303 | - return $this; |
|
304 | - } |
|
305 | - |
|
306 | - /** |
|
307 | - * @return string |
|
308 | - */ |
|
309 | - public function getZeroLineColor() |
|
310 | - { |
|
311 | - return $this->zeroLineColor; |
|
312 | - } |
|
313 | - |
|
314 | - /** |
|
315 | - * @param string $zeroLineColor |
|
316 | - * |
|
317 | - * @return $this |
|
318 | - */ |
|
319 | - public function setZeroLineColor($zeroLineColor) |
|
320 | - { |
|
321 | - $this->zeroLineColor = is_null($zeroLineColor) ? null : strval($zeroLineColor); |
|
322 | - |
|
323 | - return $this; |
|
324 | - } |
|
325 | - |
|
326 | - /** |
|
327 | - * @return boolean |
|
328 | - */ |
|
329 | - public function isOffsetGridLines() |
|
330 | - { |
|
331 | - return $this->offsetGridLines; |
|
332 | - } |
|
333 | - |
|
334 | - /** |
|
335 | - * @param boolean $offsetGridLines |
|
336 | - * |
|
337 | - * @return $this |
|
338 | - */ |
|
339 | - public function setOffsetGridLines($offsetGridLines) |
|
340 | - { |
|
341 | - $this->offsetGridLines = boolval($offsetGridLines); |
|
342 | - |
|
343 | - return $this; |
|
344 | - } |
|
345 | - |
|
346 | - /** |
|
347 | - * @return string |
|
348 | - * @throws \ReflectionException |
|
349 | - * @throws \Zend_Reflection_Exception |
|
350 | - */ |
|
351 | - public function jsonSerialize() |
|
352 | - { |
|
353 | - return Json::encode($this->getArrayCopy()); |
|
354 | - } |
|
16 | + use ArraySerializable; |
|
17 | + |
|
18 | + /** |
|
19 | + * @var bool |
|
20 | + */ |
|
21 | + private $display; |
|
22 | + |
|
23 | + /** |
|
24 | + * @var string|string[] |
|
25 | + */ |
|
26 | + private $color; |
|
27 | + |
|
28 | + /** |
|
29 | + * @var float[] |
|
30 | + */ |
|
31 | + private $borderDash; |
|
32 | + |
|
33 | + /** |
|
34 | + * @var float |
|
35 | + */ |
|
36 | + private $borderDashOffset; |
|
37 | + |
|
38 | + /** |
|
39 | + * @var int|int[] |
|
40 | + */ |
|
41 | + private $lineWidth; |
|
42 | + |
|
43 | + /** |
|
44 | + * @var bool |
|
45 | + */ |
|
46 | + private $drawBorder; |
|
47 | + |
|
48 | + /** |
|
49 | + * @var bool |
|
50 | + */ |
|
51 | + private $drawOnChartArea; |
|
52 | + |
|
53 | + /** |
|
54 | + * @var bool |
|
55 | + */ |
|
56 | + private $drawTicks; |
|
57 | + |
|
58 | + /** |
|
59 | + * @var int |
|
60 | + */ |
|
61 | + private $tickMarkLength; |
|
62 | + |
|
63 | + /** |
|
64 | + * @var int |
|
65 | + */ |
|
66 | + private $zeroLineWidth; |
|
67 | + |
|
68 | + /** |
|
69 | + * @var string |
|
70 | + */ |
|
71 | + private $zeroLineColor; |
|
72 | + |
|
73 | + /** |
|
74 | + * @var bool |
|
75 | + */ |
|
76 | + private $offsetGridLines; |
|
77 | + |
|
78 | + /** |
|
79 | + * @return boolean |
|
80 | + */ |
|
81 | + public function isDisplay() |
|
82 | + { |
|
83 | + return $this->display; |
|
84 | + } |
|
85 | + |
|
86 | + /** |
|
87 | + * @param boolean $display |
|
88 | + * |
|
89 | + * @return $this |
|
90 | + */ |
|
91 | + public function setDisplay($display) |
|
92 | + { |
|
93 | + $this->display = $display; |
|
94 | + |
|
95 | + return $this; |
|
96 | + } |
|
97 | + |
|
98 | + /** |
|
99 | + * @return string|string[] |
|
100 | + */ |
|
101 | + public function getColor() |
|
102 | + { |
|
103 | + return $this->color; |
|
104 | + } |
|
105 | + |
|
106 | + /** |
|
107 | + * @param string|string[] $color |
|
108 | + * |
|
109 | + * @return $this |
|
110 | + */ |
|
111 | + public function setColor($color) |
|
112 | + { |
|
113 | + if (is_array($color)) { |
|
114 | + array_walk_recursive( |
|
115 | + $color, |
|
116 | + function (&$value) { |
|
117 | + $value = strval($value); |
|
118 | + } |
|
119 | + ); |
|
120 | + $this->color = $color; |
|
121 | + } else { |
|
122 | + $this->color = is_null($color) ? null : strval($color); |
|
123 | + } |
|
124 | + |
|
125 | + return $this; |
|
126 | + } |
|
127 | + |
|
128 | + /** |
|
129 | + * @return \float[] |
|
130 | + */ |
|
131 | + public function getBorderDash() |
|
132 | + { |
|
133 | + return $this->borderDash; |
|
134 | + } |
|
135 | + |
|
136 | + /** |
|
137 | + * @param \float[] $borderDash |
|
138 | + * |
|
139 | + * @return $this |
|
140 | + */ |
|
141 | + public function setBorderDash($borderDash) |
|
142 | + { |
|
143 | + if (is_array($borderDash)) { |
|
144 | + array_walk_recursive( |
|
145 | + $borderDash, |
|
146 | + function (&$value) { |
|
147 | + $value = floatval($value); |
|
148 | + } |
|
149 | + ); |
|
150 | + $this->borderDash = $borderDash; |
|
151 | + } |
|
152 | + |
|
153 | + return $this; |
|
154 | + } |
|
155 | + |
|
156 | + /** |
|
157 | + * @return float |
|
158 | + */ |
|
159 | + public function getBorderDashOffset() |
|
160 | + { |
|
161 | + return $this->borderDashOffset; |
|
162 | + } |
|
163 | + |
|
164 | + /** |
|
165 | + * @param float $borderDashOffset |
|
166 | + * |
|
167 | + * @return $this |
|
168 | + */ |
|
169 | + public function setBorderDashOffset($borderDashOffset) |
|
170 | + { |
|
171 | + $this->borderDashOffset = floatval($borderDashOffset); |
|
172 | + |
|
173 | + return $this; |
|
174 | + } |
|
175 | + |
|
176 | + /** |
|
177 | + * @return int|int[] |
|
178 | + */ |
|
179 | + public function getLineWidth() |
|
180 | + { |
|
181 | + return $this->lineWidth; |
|
182 | + } |
|
183 | + |
|
184 | + /** |
|
185 | + * @param int|int[] $lineWidth |
|
186 | + * |
|
187 | + * @return $this |
|
188 | + */ |
|
189 | + public function setLineWidth($lineWidth) |
|
190 | + { |
|
191 | + if (is_array($lineWidth)) { |
|
192 | + array_walk_recursive( |
|
193 | + $lineWidth, |
|
194 | + function (&$value) { |
|
195 | + $value = intval($value); |
|
196 | + } |
|
197 | + ); |
|
198 | + $this->lineWidth = $lineWidth; |
|
199 | + } else { |
|
200 | + $this->lineWidth = is_null($lineWidth) ? null : intval($lineWidth); |
|
201 | + } |
|
202 | + |
|
203 | + return $this; |
|
204 | + } |
|
205 | + |
|
206 | + /** |
|
207 | + * @return boolean |
|
208 | + */ |
|
209 | + public function isDrawBorder() |
|
210 | + { |
|
211 | + return $this->drawBorder; |
|
212 | + } |
|
213 | + |
|
214 | + /** |
|
215 | + * @param boolean $drawBorder |
|
216 | + * |
|
217 | + * @return $this |
|
218 | + */ |
|
219 | + public function setDrawBorder($drawBorder) |
|
220 | + { |
|
221 | + $this->drawBorder = boolval($drawBorder); |
|
222 | + |
|
223 | + return $this; |
|
224 | + } |
|
225 | + |
|
226 | + /** |
|
227 | + * @return boolean |
|
228 | + */ |
|
229 | + public function isDrawOnChartArea() |
|
230 | + { |
|
231 | + return $this->drawOnChartArea; |
|
232 | + } |
|
233 | + |
|
234 | + /** |
|
235 | + * @param boolean $drawOnChartArea |
|
236 | + * |
|
237 | + * @return $this |
|
238 | + */ |
|
239 | + public function setDrawOnChartArea($drawOnChartArea) |
|
240 | + { |
|
241 | + $this->drawOnChartArea = boolval($drawOnChartArea); |
|
242 | + |
|
243 | + return $this; |
|
244 | + } |
|
245 | + |
|
246 | + /** |
|
247 | + * @return boolean |
|
248 | + */ |
|
249 | + public function isDrawTicks() |
|
250 | + { |
|
251 | + return $this->drawTicks; |
|
252 | + } |
|
253 | + |
|
254 | + /** |
|
255 | + * @param boolean $drawTicks |
|
256 | + * |
|
257 | + * @return $this |
|
258 | + */ |
|
259 | + public function setDrawTicks($drawTicks) |
|
260 | + { |
|
261 | + $this->drawTicks = boolval($drawTicks); |
|
262 | + |
|
263 | + return $this; |
|
264 | + } |
|
265 | + |
|
266 | + /** |
|
267 | + * @return int |
|
268 | + */ |
|
269 | + public function getTickMarkLength() |
|
270 | + { |
|
271 | + return $this->tickMarkLength; |
|
272 | + } |
|
273 | + |
|
274 | + /** |
|
275 | + * @param int $tickMarkLength |
|
276 | + * |
|
277 | + * @return $this |
|
278 | + */ |
|
279 | + public function setTickMarkLength($tickMarkLength) |
|
280 | + { |
|
281 | + $this->tickMarkLength = intval($tickMarkLength); |
|
282 | + |
|
283 | + return $this; |
|
284 | + } |
|
285 | + |
|
286 | + /** |
|
287 | + * @return int |
|
288 | + */ |
|
289 | + public function getZeroLineWidth() |
|
290 | + { |
|
291 | + return $this->zeroLineWidth; |
|
292 | + } |
|
293 | + |
|
294 | + /** |
|
295 | + * @param int $zeroLineWidth |
|
296 | + * |
|
297 | + * @return $this |
|
298 | + */ |
|
299 | + public function setZeroLineWidth($zeroLineWidth) |
|
300 | + { |
|
301 | + $this->zeroLineWidth = intval($zeroLineWidth); |
|
302 | + |
|
303 | + return $this; |
|
304 | + } |
|
305 | + |
|
306 | + /** |
|
307 | + * @return string |
|
308 | + */ |
|
309 | + public function getZeroLineColor() |
|
310 | + { |
|
311 | + return $this->zeroLineColor; |
|
312 | + } |
|
313 | + |
|
314 | + /** |
|
315 | + * @param string $zeroLineColor |
|
316 | + * |
|
317 | + * @return $this |
|
318 | + */ |
|
319 | + public function setZeroLineColor($zeroLineColor) |
|
320 | + { |
|
321 | + $this->zeroLineColor = is_null($zeroLineColor) ? null : strval($zeroLineColor); |
|
322 | + |
|
323 | + return $this; |
|
324 | + } |
|
325 | + |
|
326 | + /** |
|
327 | + * @return boolean |
|
328 | + */ |
|
329 | + public function isOffsetGridLines() |
|
330 | + { |
|
331 | + return $this->offsetGridLines; |
|
332 | + } |
|
333 | + |
|
334 | + /** |
|
335 | + * @param boolean $offsetGridLines |
|
336 | + * |
|
337 | + * @return $this |
|
338 | + */ |
|
339 | + public function setOffsetGridLines($offsetGridLines) |
|
340 | + { |
|
341 | + $this->offsetGridLines = boolval($offsetGridLines); |
|
342 | + |
|
343 | + return $this; |
|
344 | + } |
|
345 | + |
|
346 | + /** |
|
347 | + * @return string |
|
348 | + * @throws \ReflectionException |
|
349 | + * @throws \Zend_Reflection_Exception |
|
350 | + */ |
|
351 | + public function jsonSerialize() |
|
352 | + { |
|
353 | + return Json::encode($this->getArrayCopy()); |
|
354 | + } |
|
355 | 355 | } |