@@ -17,115 +17,115 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class Elements implements ArraySerializableInterface, \JsonSerializable |
| 19 | 19 | { |
| 20 | - use ArraySerializable; |
|
| 21 | - |
|
| 22 | - /** |
|
| 23 | - * @var Rectangle |
|
| 24 | - */ |
|
| 25 | - private $rectangle; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * @var Line |
|
| 29 | - */ |
|
| 30 | - private $line; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * @var Point |
|
| 34 | - */ |
|
| 35 | - private $point; |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * @var Arc |
|
| 39 | - */ |
|
| 40 | - private $arc; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * @return Rectangle |
|
| 44 | - */ |
|
| 45 | - public function getRectangle() |
|
| 46 | - { |
|
| 47 | - return $this->rectangle; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @return Rectangle |
|
| 52 | - */ |
|
| 53 | - public function rectangle() |
|
| 54 | - { |
|
| 55 | - if (is_null($this->rectangle)) { |
|
| 56 | - $this->rectangle = new Rectangle(); |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - return $this->rectangle; |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * @return Line |
|
| 64 | - */ |
|
| 65 | - public function getLine() |
|
| 66 | - { |
|
| 67 | - return $this->line; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * @return Line |
|
| 72 | - */ |
|
| 73 | - public function line() |
|
| 74 | - { |
|
| 75 | - if (is_null($this->line)) { |
|
| 76 | - $this->line = new Line(); |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - return $this->line; |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - /** |
|
| 83 | - * @return Point |
|
| 84 | - */ |
|
| 85 | - public function getPoint() |
|
| 86 | - { |
|
| 87 | - return $this->point; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * @return Point |
|
| 92 | - */ |
|
| 93 | - public function point() |
|
| 94 | - { |
|
| 95 | - if (is_null($this->point)) { |
|
| 96 | - $this->point = new Point(); |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - return $this->point; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * @return Arc |
|
| 104 | - */ |
|
| 105 | - public function getArc() |
|
| 106 | - { |
|
| 107 | - return $this->arc; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * @return Arc |
|
| 112 | - */ |
|
| 113 | - public function arc() |
|
| 114 | - { |
|
| 115 | - if (is_null($this->arc)) { |
|
| 116 | - $this->arc = new Arc(); |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - return $this->arc; |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * @return string |
|
| 124 | - * @throws \ReflectionException |
|
| 125 | - * @throws \Zend_Reflection_Exception |
|
| 126 | - */ |
|
| 127 | - public function jsonSerialize() |
|
| 128 | - { |
|
| 129 | - return Json::encode($this->getArrayCopy()); |
|
| 130 | - } |
|
| 20 | + use ArraySerializable; |
|
| 21 | + |
|
| 22 | + /** |
|
| 23 | + * @var Rectangle |
|
| 24 | + */ |
|
| 25 | + private $rectangle; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * @var Line |
|
| 29 | + */ |
|
| 30 | + private $line; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @var Point |
|
| 34 | + */ |
|
| 35 | + private $point; |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * @var Arc |
|
| 39 | + */ |
|
| 40 | + private $arc; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * @return Rectangle |
|
| 44 | + */ |
|
| 45 | + public function getRectangle() |
|
| 46 | + { |
|
| 47 | + return $this->rectangle; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @return Rectangle |
|
| 52 | + */ |
|
| 53 | + public function rectangle() |
|
| 54 | + { |
|
| 55 | + if (is_null($this->rectangle)) { |
|
| 56 | + $this->rectangle = new Rectangle(); |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + return $this->rectangle; |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * @return Line |
|
| 64 | + */ |
|
| 65 | + public function getLine() |
|
| 66 | + { |
|
| 67 | + return $this->line; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * @return Line |
|
| 72 | + */ |
|
| 73 | + public function line() |
|
| 74 | + { |
|
| 75 | + if (is_null($this->line)) { |
|
| 76 | + $this->line = new Line(); |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + return $this->line; |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * @return Point |
|
| 84 | + */ |
|
| 85 | + public function getPoint() |
|
| 86 | + { |
|
| 87 | + return $this->point; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * @return Point |
|
| 92 | + */ |
|
| 93 | + public function point() |
|
| 94 | + { |
|
| 95 | + if (is_null($this->point)) { |
|
| 96 | + $this->point = new Point(); |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + return $this->point; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @return Arc |
|
| 104 | + */ |
|
| 105 | + public function getArc() |
|
| 106 | + { |
|
| 107 | + return $this->arc; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * @return Arc |
|
| 112 | + */ |
|
| 113 | + public function arc() |
|
| 114 | + { |
|
| 115 | + if (is_null($this->arc)) { |
|
| 116 | + $this->arc = new Arc(); |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + return $this->arc; |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * @return string |
|
| 124 | + * @throws \ReflectionException |
|
| 125 | + * @throws \Zend_Reflection_Exception |
|
| 126 | + */ |
|
| 127 | + public function jsonSerialize() |
|
| 128 | + { |
|
| 129 | + return Json::encode($this->getArrayCopy()); |
|
| 130 | + } |
|
| 131 | 131 | } |
@@ -215,7 +215,7 @@ |
||
| 215 | 215 | if (is_array($borderDash)) { |
| 216 | 216 | array_walk_recursive( |
| 217 | 217 | $borderDash, |
| 218 | - function (&$value) { |
|
| 218 | + function(&$value) { |
|
| 219 | 219 | $value = intval($value); |
| 220 | 220 | } |
| 221 | 221 | ); |
@@ -13,314 +13,314 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class Line implements ArraySerializableInterface, \JsonSerializable |
| 15 | 15 | { |
| 16 | - use ArraySerializable; |
|
| 17 | - |
|
| 18 | - /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap */ |
|
| 19 | - const CAP_STYLE_BUTT = 'butt'; |
|
| 20 | - const CAP_STYLE_ROUND = 'round'; |
|
| 21 | - const CAP_STYLE_SQUARE = 'square'; |
|
| 22 | - |
|
| 23 | - /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin */ |
|
| 24 | - const JOIN_STYLE_ROUND = 'round'; |
|
| 25 | - const JOIN_STYLE_BEVEL = 'bevel'; |
|
| 26 | - const JOIN_STYLE_MITER = 'miter'; |
|
| 27 | - |
|
| 28 | - const FILL_LOCATION_ZERO = 'zero'; |
|
| 29 | - const FILL_LOCATION_TOP = 'top'; |
|
| 30 | - const FILL_LOCATION_BOTTOM = 'bottom'; |
|
| 31 | - const FILL_LOCATION_TRUE = true; |
|
| 32 | - const FILL_LOCATION_FALSE = false; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * Bézier curve tension (0 for no Bézier curves). |
|
| 36 | - * @default 0.4 |
|
| 37 | - * @var float |
|
| 38 | - */ |
|
| 39 | - private $tension; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * Line fill color. |
|
| 43 | - * @default 'rgba(0,0,0,0.1)' |
|
| 44 | - * @var string |
|
| 45 | - */ |
|
| 46 | - private $backgroundColor; |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * Line stroke width. |
|
| 50 | - * @default 3 |
|
| 51 | - * @var int |
|
| 52 | - */ |
|
| 53 | - private $borderWidth; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * Line stroke color. |
|
| 57 | - * @default 'rgba(0,0,0,0.1)' |
|
| 58 | - * @var string |
|
| 59 | - */ |
|
| 60 | - private $borderColor; |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * Line cap style. |
|
| 64 | - * @default self::CAP_STYLE_BUTT |
|
| 65 | - * @var string |
|
| 66 | - */ |
|
| 67 | - private $borderCapStyle; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * Line dash. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash |
|
| 71 | - * @default [] |
|
| 72 | - * @var int[] |
|
| 73 | - */ |
|
| 74 | - private $borderDash; |
|
| 75 | - |
|
| 76 | - /** |
|
| 77 | - * Line dash offset. |
|
| 78 | - * @default 0 |
|
| 79 | - * @var float |
|
| 80 | - */ |
|
| 81 | - private $borderDashOffset; |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * Line join style. |
|
| 85 | - * @default self::JOIN_STYLE_MITER |
|
| 86 | - * @var string |
|
| 87 | - */ |
|
| 88 | - private $borderJoinStyle; |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * true to keep Bézier control inside the chart, false for no restriction. |
|
| 92 | - * @default true |
|
| 93 | - * @var bool |
|
| 94 | - */ |
|
| 95 | - private $capBezierPoints; |
|
| 96 | - |
|
| 97 | - /** |
|
| 98 | - * Fill location: 'zero', 'top', 'bottom', true (eq. 'zero') or false (no fill). |
|
| 99 | - * @default self::FILL_LOCATION_TRUE |
|
| 100 | - * @var bool|string |
|
| 101 | - */ |
|
| 102 | - private $fill; |
|
| 103 | - |
|
| 104 | - /** |
|
| 105 | - * true to show the line as a stepped line (tension will be ignored). |
|
| 106 | - * @default false |
|
| 107 | - * @var bool |
|
| 108 | - */ |
|
| 109 | - private $stepped; |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * @return float |
|
| 113 | - */ |
|
| 114 | - public function getTension() |
|
| 115 | - { |
|
| 116 | - return $this->tension; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * @param float $tension |
|
| 121 | - * @return Line |
|
| 122 | - */ |
|
| 123 | - public function setTension($tension) |
|
| 124 | - { |
|
| 125 | - $this->tension = floatval($tension); |
|
| 126 | - return $this; |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - /** |
|
| 130 | - * @return string |
|
| 131 | - */ |
|
| 132 | - public function getBackgroundColor() |
|
| 133 | - { |
|
| 134 | - return $this->backgroundColor; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * @param string $backgroundColor |
|
| 139 | - * @return Line |
|
| 140 | - */ |
|
| 141 | - public function setBackgroundColor($backgroundColor) |
|
| 142 | - { |
|
| 143 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 144 | - return $this; |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - /** |
|
| 148 | - * @return int |
|
| 149 | - */ |
|
| 150 | - public function getBorderWidth() |
|
| 151 | - { |
|
| 152 | - return $this->borderWidth; |
|
| 153 | - } |
|
| 154 | - |
|
| 155 | - /** |
|
| 156 | - * @param int $borderWidth |
|
| 157 | - * @return Line |
|
| 158 | - */ |
|
| 159 | - public function setBorderWidth($borderWidth) |
|
| 160 | - { |
|
| 161 | - $this->borderWidth = intval($borderWidth); |
|
| 162 | - return $this; |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - /** |
|
| 166 | - * @return string |
|
| 167 | - */ |
|
| 168 | - public function getBorderColor() |
|
| 169 | - { |
|
| 170 | - return $this->borderColor; |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - /** |
|
| 174 | - * @param string $borderColor |
|
| 175 | - * @return Line |
|
| 176 | - */ |
|
| 177 | - public function setBorderColor($borderColor) |
|
| 178 | - { |
|
| 179 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 180 | - return $this; |
|
| 181 | - } |
|
| 182 | - |
|
| 183 | - /** |
|
| 184 | - * @return string |
|
| 185 | - */ |
|
| 186 | - public function getBorderCapStyle() |
|
| 187 | - { |
|
| 188 | - return $this->borderCapStyle; |
|
| 189 | - } |
|
| 190 | - |
|
| 191 | - /** |
|
| 192 | - * @param string $borderCapStyle |
|
| 193 | - * @return Line |
|
| 194 | - */ |
|
| 195 | - public function setBorderCapStyle($borderCapStyle) |
|
| 196 | - { |
|
| 197 | - $this->borderCapStyle = is_null($borderCapStyle) ? null : strval($borderCapStyle); |
|
| 198 | - return $this; |
|
| 199 | - } |
|
| 200 | - |
|
| 201 | - /** |
|
| 202 | - * @return int[] |
|
| 203 | - */ |
|
| 204 | - public function getBorderDash() |
|
| 205 | - { |
|
| 206 | - return $this->borderDash; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - /** |
|
| 210 | - * @param int[] $borderDash |
|
| 211 | - * @return Line |
|
| 212 | - */ |
|
| 213 | - public function setBorderDash($borderDash) |
|
| 214 | - { |
|
| 215 | - if (is_array($borderDash)) { |
|
| 216 | - array_walk_recursive( |
|
| 217 | - $borderDash, |
|
| 218 | - function (&$value) { |
|
| 219 | - $value = intval($value); |
|
| 220 | - } |
|
| 221 | - ); |
|
| 222 | - $this->borderDash = $borderDash; |
|
| 223 | - } |
|
| 224 | - return $this; |
|
| 225 | - } |
|
| 226 | - |
|
| 227 | - /** |
|
| 228 | - * @return float |
|
| 229 | - */ |
|
| 230 | - public function getBorderDashOffset() |
|
| 231 | - { |
|
| 232 | - return $this->borderDashOffset; |
|
| 233 | - } |
|
| 234 | - |
|
| 235 | - /** |
|
| 236 | - * @param float $borderDashOffset |
|
| 237 | - * @return Line |
|
| 238 | - */ |
|
| 239 | - public function setBorderDashOffset($borderDashOffset) |
|
| 240 | - { |
|
| 241 | - $this->borderDashOffset = floatval($borderDashOffset); |
|
| 242 | - return $this; |
|
| 243 | - } |
|
| 244 | - |
|
| 245 | - /** |
|
| 246 | - * @return string |
|
| 247 | - */ |
|
| 248 | - public function getBorderJoinStyle() |
|
| 249 | - { |
|
| 250 | - return $this->borderJoinStyle; |
|
| 251 | - } |
|
| 252 | - |
|
| 253 | - /** |
|
| 254 | - * @param string $borderJoinStyle |
|
| 255 | - * @return Line |
|
| 256 | - */ |
|
| 257 | - public function setBorderJoinStyle($borderJoinStyle) |
|
| 258 | - { |
|
| 259 | - $this->borderJoinStyle = is_null($borderJoinStyle) ? null : strval($borderJoinStyle); |
|
| 260 | - return $this; |
|
| 261 | - } |
|
| 262 | - |
|
| 263 | - /** |
|
| 264 | - * @return bool |
|
| 265 | - */ |
|
| 266 | - public function isCapBezierPoints() |
|
| 267 | - { |
|
| 268 | - return $this->capBezierPoints; |
|
| 269 | - } |
|
| 270 | - |
|
| 271 | - /** |
|
| 272 | - * @param bool $capBezierPoints |
|
| 273 | - * @return Line |
|
| 274 | - */ |
|
| 275 | - public function setCapBezierPoints($capBezierPoints) |
|
| 276 | - { |
|
| 277 | - $this->capBezierPoints = boolval($capBezierPoints); |
|
| 278 | - return $this; |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - /** |
|
| 282 | - * @return bool|string |
|
| 283 | - */ |
|
| 284 | - public function getFill() |
|
| 285 | - { |
|
| 286 | - return $this->fill; |
|
| 287 | - } |
|
| 288 | - |
|
| 289 | - /** |
|
| 290 | - * @param bool|string $fill |
|
| 291 | - * @return Line |
|
| 292 | - */ |
|
| 293 | - public function setFill($fill) |
|
| 294 | - { |
|
| 295 | - $this->fill = is_null($fill) ? null : (is_bool($fill) ? $fill : strval($fill)); |
|
| 296 | - return $this; |
|
| 297 | - } |
|
| 298 | - |
|
| 299 | - /** |
|
| 300 | - * @return bool |
|
| 301 | - */ |
|
| 302 | - public function isStepped() |
|
| 303 | - { |
|
| 304 | - return $this->stepped; |
|
| 305 | - } |
|
| 306 | - |
|
| 307 | - /** |
|
| 308 | - * @param bool $stepped |
|
| 309 | - * @return Line |
|
| 310 | - */ |
|
| 311 | - public function setStepped($stepped) |
|
| 312 | - { |
|
| 313 | - $this->stepped = boolval($stepped); |
|
| 314 | - return $this; |
|
| 315 | - } |
|
| 316 | - |
|
| 317 | - /** |
|
| 318 | - * @return string |
|
| 319 | - * @throws \ReflectionException |
|
| 320 | - * @throws \Zend_Reflection_Exception |
|
| 321 | - */ |
|
| 322 | - public function jsonSerialize() |
|
| 323 | - { |
|
| 324 | - return Json::encode($this->getArrayCopy()); |
|
| 325 | - } |
|
| 16 | + use ArraySerializable; |
|
| 17 | + |
|
| 18 | + /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap */ |
|
| 19 | + const CAP_STYLE_BUTT = 'butt'; |
|
| 20 | + const CAP_STYLE_ROUND = 'round'; |
|
| 21 | + const CAP_STYLE_SQUARE = 'square'; |
|
| 22 | + |
|
| 23 | + /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin */ |
|
| 24 | + const JOIN_STYLE_ROUND = 'round'; |
|
| 25 | + const JOIN_STYLE_BEVEL = 'bevel'; |
|
| 26 | + const JOIN_STYLE_MITER = 'miter'; |
|
| 27 | + |
|
| 28 | + const FILL_LOCATION_ZERO = 'zero'; |
|
| 29 | + const FILL_LOCATION_TOP = 'top'; |
|
| 30 | + const FILL_LOCATION_BOTTOM = 'bottom'; |
|
| 31 | + const FILL_LOCATION_TRUE = true; |
|
| 32 | + const FILL_LOCATION_FALSE = false; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * Bézier curve tension (0 for no Bézier curves). |
|
| 36 | + * @default 0.4 |
|
| 37 | + * @var float |
|
| 38 | + */ |
|
| 39 | + private $tension; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * Line fill color. |
|
| 43 | + * @default 'rgba(0,0,0,0.1)' |
|
| 44 | + * @var string |
|
| 45 | + */ |
|
| 46 | + private $backgroundColor; |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * Line stroke width. |
|
| 50 | + * @default 3 |
|
| 51 | + * @var int |
|
| 52 | + */ |
|
| 53 | + private $borderWidth; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * Line stroke color. |
|
| 57 | + * @default 'rgba(0,0,0,0.1)' |
|
| 58 | + * @var string |
|
| 59 | + */ |
|
| 60 | + private $borderColor; |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * Line cap style. |
|
| 64 | + * @default self::CAP_STYLE_BUTT |
|
| 65 | + * @var string |
|
| 66 | + */ |
|
| 67 | + private $borderCapStyle; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * Line dash. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash |
|
| 71 | + * @default [] |
|
| 72 | + * @var int[] |
|
| 73 | + */ |
|
| 74 | + private $borderDash; |
|
| 75 | + |
|
| 76 | + /** |
|
| 77 | + * Line dash offset. |
|
| 78 | + * @default 0 |
|
| 79 | + * @var float |
|
| 80 | + */ |
|
| 81 | + private $borderDashOffset; |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * Line join style. |
|
| 85 | + * @default self::JOIN_STYLE_MITER |
|
| 86 | + * @var string |
|
| 87 | + */ |
|
| 88 | + private $borderJoinStyle; |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * true to keep Bézier control inside the chart, false for no restriction. |
|
| 92 | + * @default true |
|
| 93 | + * @var bool |
|
| 94 | + */ |
|
| 95 | + private $capBezierPoints; |
|
| 96 | + |
|
| 97 | + /** |
|
| 98 | + * Fill location: 'zero', 'top', 'bottom', true (eq. 'zero') or false (no fill). |
|
| 99 | + * @default self::FILL_LOCATION_TRUE |
|
| 100 | + * @var bool|string |
|
| 101 | + */ |
|
| 102 | + private $fill; |
|
| 103 | + |
|
| 104 | + /** |
|
| 105 | + * true to show the line as a stepped line (tension will be ignored). |
|
| 106 | + * @default false |
|
| 107 | + * @var bool |
|
| 108 | + */ |
|
| 109 | + private $stepped; |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * @return float |
|
| 113 | + */ |
|
| 114 | + public function getTension() |
|
| 115 | + { |
|
| 116 | + return $this->tension; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * @param float $tension |
|
| 121 | + * @return Line |
|
| 122 | + */ |
|
| 123 | + public function setTension($tension) |
|
| 124 | + { |
|
| 125 | + $this->tension = floatval($tension); |
|
| 126 | + return $this; |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + /** |
|
| 130 | + * @return string |
|
| 131 | + */ |
|
| 132 | + public function getBackgroundColor() |
|
| 133 | + { |
|
| 134 | + return $this->backgroundColor; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * @param string $backgroundColor |
|
| 139 | + * @return Line |
|
| 140 | + */ |
|
| 141 | + public function setBackgroundColor($backgroundColor) |
|
| 142 | + { |
|
| 143 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 144 | + return $this; |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * @return int |
|
| 149 | + */ |
|
| 150 | + public function getBorderWidth() |
|
| 151 | + { |
|
| 152 | + return $this->borderWidth; |
|
| 153 | + } |
|
| 154 | + |
|
| 155 | + /** |
|
| 156 | + * @param int $borderWidth |
|
| 157 | + * @return Line |
|
| 158 | + */ |
|
| 159 | + public function setBorderWidth($borderWidth) |
|
| 160 | + { |
|
| 161 | + $this->borderWidth = intval($borderWidth); |
|
| 162 | + return $this; |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + /** |
|
| 166 | + * @return string |
|
| 167 | + */ |
|
| 168 | + public function getBorderColor() |
|
| 169 | + { |
|
| 170 | + return $this->borderColor; |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + /** |
|
| 174 | + * @param string $borderColor |
|
| 175 | + * @return Line |
|
| 176 | + */ |
|
| 177 | + public function setBorderColor($borderColor) |
|
| 178 | + { |
|
| 179 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 180 | + return $this; |
|
| 181 | + } |
|
| 182 | + |
|
| 183 | + /** |
|
| 184 | + * @return string |
|
| 185 | + */ |
|
| 186 | + public function getBorderCapStyle() |
|
| 187 | + { |
|
| 188 | + return $this->borderCapStyle; |
|
| 189 | + } |
|
| 190 | + |
|
| 191 | + /** |
|
| 192 | + * @param string $borderCapStyle |
|
| 193 | + * @return Line |
|
| 194 | + */ |
|
| 195 | + public function setBorderCapStyle($borderCapStyle) |
|
| 196 | + { |
|
| 197 | + $this->borderCapStyle = is_null($borderCapStyle) ? null : strval($borderCapStyle); |
|
| 198 | + return $this; |
|
| 199 | + } |
|
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * @return int[] |
|
| 203 | + */ |
|
| 204 | + public function getBorderDash() |
|
| 205 | + { |
|
| 206 | + return $this->borderDash; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + /** |
|
| 210 | + * @param int[] $borderDash |
|
| 211 | + * @return Line |
|
| 212 | + */ |
|
| 213 | + public function setBorderDash($borderDash) |
|
| 214 | + { |
|
| 215 | + if (is_array($borderDash)) { |
|
| 216 | + array_walk_recursive( |
|
| 217 | + $borderDash, |
|
| 218 | + function (&$value) { |
|
| 219 | + $value = intval($value); |
|
| 220 | + } |
|
| 221 | + ); |
|
| 222 | + $this->borderDash = $borderDash; |
|
| 223 | + } |
|
| 224 | + return $this; |
|
| 225 | + } |
|
| 226 | + |
|
| 227 | + /** |
|
| 228 | + * @return float |
|
| 229 | + */ |
|
| 230 | + public function getBorderDashOffset() |
|
| 231 | + { |
|
| 232 | + return $this->borderDashOffset; |
|
| 233 | + } |
|
| 234 | + |
|
| 235 | + /** |
|
| 236 | + * @param float $borderDashOffset |
|
| 237 | + * @return Line |
|
| 238 | + */ |
|
| 239 | + public function setBorderDashOffset($borderDashOffset) |
|
| 240 | + { |
|
| 241 | + $this->borderDashOffset = floatval($borderDashOffset); |
|
| 242 | + return $this; |
|
| 243 | + } |
|
| 244 | + |
|
| 245 | + /** |
|
| 246 | + * @return string |
|
| 247 | + */ |
|
| 248 | + public function getBorderJoinStyle() |
|
| 249 | + { |
|
| 250 | + return $this->borderJoinStyle; |
|
| 251 | + } |
|
| 252 | + |
|
| 253 | + /** |
|
| 254 | + * @param string $borderJoinStyle |
|
| 255 | + * @return Line |
|
| 256 | + */ |
|
| 257 | + public function setBorderJoinStyle($borderJoinStyle) |
|
| 258 | + { |
|
| 259 | + $this->borderJoinStyle = is_null($borderJoinStyle) ? null : strval($borderJoinStyle); |
|
| 260 | + return $this; |
|
| 261 | + } |
|
| 262 | + |
|
| 263 | + /** |
|
| 264 | + * @return bool |
|
| 265 | + */ |
|
| 266 | + public function isCapBezierPoints() |
|
| 267 | + { |
|
| 268 | + return $this->capBezierPoints; |
|
| 269 | + } |
|
| 270 | + |
|
| 271 | + /** |
|
| 272 | + * @param bool $capBezierPoints |
|
| 273 | + * @return Line |
|
| 274 | + */ |
|
| 275 | + public function setCapBezierPoints($capBezierPoints) |
|
| 276 | + { |
|
| 277 | + $this->capBezierPoints = boolval($capBezierPoints); |
|
| 278 | + return $this; |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + /** |
|
| 282 | + * @return bool|string |
|
| 283 | + */ |
|
| 284 | + public function getFill() |
|
| 285 | + { |
|
| 286 | + return $this->fill; |
|
| 287 | + } |
|
| 288 | + |
|
| 289 | + /** |
|
| 290 | + * @param bool|string $fill |
|
| 291 | + * @return Line |
|
| 292 | + */ |
|
| 293 | + public function setFill($fill) |
|
| 294 | + { |
|
| 295 | + $this->fill = is_null($fill) ? null : (is_bool($fill) ? $fill : strval($fill)); |
|
| 296 | + return $this; |
|
| 297 | + } |
|
| 298 | + |
|
| 299 | + /** |
|
| 300 | + * @return bool |
|
| 301 | + */ |
|
| 302 | + public function isStepped() |
|
| 303 | + { |
|
| 304 | + return $this->stepped; |
|
| 305 | + } |
|
| 306 | + |
|
| 307 | + /** |
|
| 308 | + * @param bool $stepped |
|
| 309 | + * @return Line |
|
| 310 | + */ |
|
| 311 | + public function setStepped($stepped) |
|
| 312 | + { |
|
| 313 | + $this->stepped = boolval($stepped); |
|
| 314 | + return $this; |
|
| 315 | + } |
|
| 316 | + |
|
| 317 | + /** |
|
| 318 | + * @return string |
|
| 319 | + * @throws \ReflectionException |
|
| 320 | + * @throws \Zend_Reflection_Exception |
|
| 321 | + */ |
|
| 322 | + public function jsonSerialize() |
|
| 323 | + { |
|
| 324 | + return Json::encode($this->getArrayCopy()); |
|
| 325 | + } |
|
| 326 | 326 | } |
| 327 | 327 | \ No newline at end of file |
@@ -9,90 +9,90 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Arc implements ArraySerializableInterface, \JsonSerializable |
| 11 | 11 | { |
| 12 | - use ArraySerializable; |
|
| 12 | + use ArraySerializable; |
|
| 13 | 13 | |
| 14 | - /** |
|
| 15 | - * Arc fill color. |
|
| 16 | - * @default 'rgba(0,0,0,0.1)' |
|
| 17 | - * @var string |
|
| 18 | - */ |
|
| 19 | - private $backgroundColor; |
|
| 14 | + /** |
|
| 15 | + * Arc fill color. |
|
| 16 | + * @default 'rgba(0,0,0,0.1)' |
|
| 17 | + * @var string |
|
| 18 | + */ |
|
| 19 | + private $backgroundColor; |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * Arc stroke color. |
|
| 23 | - * @default '#fff' |
|
| 24 | - * @var string |
|
| 25 | - */ |
|
| 26 | - private $borderColor; |
|
| 21 | + /** |
|
| 22 | + * Arc stroke color. |
|
| 23 | + * @default '#fff' |
|
| 24 | + * @var string |
|
| 25 | + */ |
|
| 26 | + private $borderColor; |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * Arc stroke width. |
|
| 30 | - * @default 2 |
|
| 31 | - * @var int |
|
| 32 | - */ |
|
| 33 | - private $borderWidth; |
|
| 28 | + /** |
|
| 29 | + * Arc stroke width. |
|
| 30 | + * @default 2 |
|
| 31 | + * @var int |
|
| 32 | + */ |
|
| 33 | + private $borderWidth; |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * @return string |
|
| 37 | - */ |
|
| 38 | - public function getBackgroundColor() |
|
| 39 | - { |
|
| 40 | - return $this->backgroundColor; |
|
| 41 | - } |
|
| 35 | + /** |
|
| 36 | + * @return string |
|
| 37 | + */ |
|
| 38 | + public function getBackgroundColor() |
|
| 39 | + { |
|
| 40 | + return $this->backgroundColor; |
|
| 41 | + } |
|
| 42 | 42 | |
| 43 | - /** |
|
| 44 | - * @param string $backgroundColor |
|
| 45 | - * @return Arc |
|
| 46 | - */ |
|
| 47 | - public function setBackgroundColor($backgroundColor) |
|
| 48 | - { |
|
| 49 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 50 | - return $this; |
|
| 51 | - } |
|
| 43 | + /** |
|
| 44 | + * @param string $backgroundColor |
|
| 45 | + * @return Arc |
|
| 46 | + */ |
|
| 47 | + public function setBackgroundColor($backgroundColor) |
|
| 48 | + { |
|
| 49 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 50 | + return $this; |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | - /** |
|
| 54 | - * @return string |
|
| 55 | - */ |
|
| 56 | - public function getBorderColor() |
|
| 57 | - { |
|
| 58 | - return $this->borderColor; |
|
| 59 | - } |
|
| 53 | + /** |
|
| 54 | + * @return string |
|
| 55 | + */ |
|
| 56 | + public function getBorderColor() |
|
| 57 | + { |
|
| 58 | + return $this->borderColor; |
|
| 59 | + } |
|
| 60 | 60 | |
| 61 | - /** |
|
| 62 | - * @param string $borderColor |
|
| 63 | - * @return Arc |
|
| 64 | - */ |
|
| 65 | - public function setBorderColor($borderColor) |
|
| 66 | - { |
|
| 67 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 68 | - return $this; |
|
| 69 | - } |
|
| 61 | + /** |
|
| 62 | + * @param string $borderColor |
|
| 63 | + * @return Arc |
|
| 64 | + */ |
|
| 65 | + public function setBorderColor($borderColor) |
|
| 66 | + { |
|
| 67 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 68 | + return $this; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * @return int |
|
| 73 | - */ |
|
| 74 | - public function getBorderWidth() |
|
| 75 | - { |
|
| 76 | - return $this->borderWidth; |
|
| 77 | - } |
|
| 71 | + /** |
|
| 72 | + * @return int |
|
| 73 | + */ |
|
| 74 | + public function getBorderWidth() |
|
| 75 | + { |
|
| 76 | + return $this->borderWidth; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - /** |
|
| 80 | - * @param int $borderWidth |
|
| 81 | - * @return Arc |
|
| 82 | - */ |
|
| 83 | - public function setBorderWidth($borderWidth) |
|
| 84 | - { |
|
| 85 | - $this->borderWidth = intval($borderWidth); |
|
| 86 | - return $this; |
|
| 87 | - } |
|
| 79 | + /** |
|
| 80 | + * @param int $borderWidth |
|
| 81 | + * @return Arc |
|
| 82 | + */ |
|
| 83 | + public function setBorderWidth($borderWidth) |
|
| 84 | + { |
|
| 85 | + $this->borderWidth = intval($borderWidth); |
|
| 86 | + return $this; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - /** |
|
| 90 | - * @return string |
|
| 91 | - * @throws \ReflectionException |
|
| 92 | - * @throws \Zend_Reflection_Exception |
|
| 93 | - */ |
|
| 94 | - public function jsonSerialize() |
|
| 95 | - { |
|
| 96 | - return Json::encode($this->getArrayCopy()); |
|
| 97 | - } |
|
| 89 | + /** |
|
| 90 | + * @return string |
|
| 91 | + * @throws \ReflectionException |
|
| 92 | + * @throws \Zend_Reflection_Exception |
|
| 93 | + */ |
|
| 94 | + public function jsonSerialize() |
|
| 95 | + { |
|
| 96 | + return Json::encode($this->getArrayCopy()); |
|
| 97 | + } |
|
| 98 | 98 | } |
| 99 | 99 | \ No newline at end of file |
@@ -9,123 +9,123 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Rectangle implements ArraySerializableInterface, \JsonSerializable |
| 11 | 11 | { |
| 12 | - use ArraySerializable; |
|
| 13 | - |
|
| 14 | - const BORDER_SKIPPED_BOTTOM = 'bottom'; |
|
| 15 | - const BORDER_SKIPPED_LEFT = 'left'; |
|
| 16 | - const BORDER_SKIPPED_TOP = 'top'; |
|
| 17 | - const BORDER_SKIPPED_RIGHT = 'right'; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * Bar fill color. |
|
| 21 | - * @default 'rgba(0,0,0,0.1)' |
|
| 22 | - * @var string |
|
| 23 | - */ |
|
| 24 | - private $backgroundColor; |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * Bar stroke width. |
|
| 28 | - * @default 0 |
|
| 29 | - * @var int |
|
| 30 | - */ |
|
| 31 | - private $borderWidth; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Bar stroke color. |
|
| 35 | - * @default 'rgba(0,0,0,0.1)' |
|
| 36 | - * @var string |
|
| 37 | - */ |
|
| 38 | - private $borderColor; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * Skipped (excluded) border: 'bottom', 'left', 'top' or 'right'. |
|
| 42 | - * @default self::BORDER_SKIPPED_BOTTOM |
|
| 43 | - * @var string |
|
| 44 | - */ |
|
| 45 | - private $borderSkipped; |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * @return string |
|
| 49 | - */ |
|
| 50 | - public function getBackgroundColor() |
|
| 51 | - { |
|
| 52 | - return $this->backgroundColor; |
|
| 53 | - } |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @param string $backgroundColor |
|
| 57 | - * @return Rectangle |
|
| 58 | - */ |
|
| 59 | - public function setBackgroundColor($backgroundColor) |
|
| 60 | - { |
|
| 61 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 62 | - return $this; |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - /** |
|
| 66 | - * @return int |
|
| 67 | - */ |
|
| 68 | - public function getBorderWidth() |
|
| 69 | - { |
|
| 70 | - return $this->borderWidth; |
|
| 71 | - } |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * @param int $borderWidth |
|
| 75 | - * @return Rectangle |
|
| 76 | - */ |
|
| 77 | - public function setBorderWidth($borderWidth) |
|
| 78 | - { |
|
| 79 | - $this->borderWidth = intval($borderWidth); |
|
| 80 | - return $this; |
|
| 81 | - } |
|
| 82 | - |
|
| 83 | - /** |
|
| 84 | - * @return string |
|
| 85 | - */ |
|
| 86 | - public function getBorderColor() |
|
| 87 | - { |
|
| 88 | - return $this->borderColor; |
|
| 89 | - } |
|
| 90 | - |
|
| 91 | - /** |
|
| 92 | - * @param string $borderColor |
|
| 93 | - * @return Rectangle |
|
| 94 | - */ |
|
| 95 | - public function setBorderColor($borderColor) |
|
| 96 | - { |
|
| 97 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 98 | - return $this; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * @return string |
|
| 103 | - */ |
|
| 104 | - public function getBorderSkipped() |
|
| 105 | - { |
|
| 106 | - return $this->borderSkipped; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * @param string $borderSkipped |
|
| 111 | - * @return Rectangle |
|
| 112 | - */ |
|
| 113 | - public function setBorderSkipped($borderSkipped) |
|
| 114 | - { |
|
| 115 | - $this->borderSkipped = is_null($borderSkipped) ? null : strval($borderSkipped); |
|
| 116 | - return $this; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * @return string |
|
| 123 | - * @throws \ReflectionException |
|
| 124 | - * @throws \Zend_Reflection_Exception |
|
| 125 | - */ |
|
| 126 | - public function jsonSerialize() |
|
| 127 | - { |
|
| 128 | - return Json::encode($this->getArrayCopy()); |
|
| 129 | - } |
|
| 12 | + use ArraySerializable; |
|
| 13 | + |
|
| 14 | + const BORDER_SKIPPED_BOTTOM = 'bottom'; |
|
| 15 | + const BORDER_SKIPPED_LEFT = 'left'; |
|
| 16 | + const BORDER_SKIPPED_TOP = 'top'; |
|
| 17 | + const BORDER_SKIPPED_RIGHT = 'right'; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * Bar fill color. |
|
| 21 | + * @default 'rgba(0,0,0,0.1)' |
|
| 22 | + * @var string |
|
| 23 | + */ |
|
| 24 | + private $backgroundColor; |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * Bar stroke width. |
|
| 28 | + * @default 0 |
|
| 29 | + * @var int |
|
| 30 | + */ |
|
| 31 | + private $borderWidth; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Bar stroke color. |
|
| 35 | + * @default 'rgba(0,0,0,0.1)' |
|
| 36 | + * @var string |
|
| 37 | + */ |
|
| 38 | + private $borderColor; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * Skipped (excluded) border: 'bottom', 'left', 'top' or 'right'. |
|
| 42 | + * @default self::BORDER_SKIPPED_BOTTOM |
|
| 43 | + * @var string |
|
| 44 | + */ |
|
| 45 | + private $borderSkipped; |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * @return string |
|
| 49 | + */ |
|
| 50 | + public function getBackgroundColor() |
|
| 51 | + { |
|
| 52 | + return $this->backgroundColor; |
|
| 53 | + } |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @param string $backgroundColor |
|
| 57 | + * @return Rectangle |
|
| 58 | + */ |
|
| 59 | + public function setBackgroundColor($backgroundColor) |
|
| 60 | + { |
|
| 61 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 62 | + return $this; |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + /** |
|
| 66 | + * @return int |
|
| 67 | + */ |
|
| 68 | + public function getBorderWidth() |
|
| 69 | + { |
|
| 70 | + return $this->borderWidth; |
|
| 71 | + } |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * @param int $borderWidth |
|
| 75 | + * @return Rectangle |
|
| 76 | + */ |
|
| 77 | + public function setBorderWidth($borderWidth) |
|
| 78 | + { |
|
| 79 | + $this->borderWidth = intval($borderWidth); |
|
| 80 | + return $this; |
|
| 81 | + } |
|
| 82 | + |
|
| 83 | + /** |
|
| 84 | + * @return string |
|
| 85 | + */ |
|
| 86 | + public function getBorderColor() |
|
| 87 | + { |
|
| 88 | + return $this->borderColor; |
|
| 89 | + } |
|
| 90 | + |
|
| 91 | + /** |
|
| 92 | + * @param string $borderColor |
|
| 93 | + * @return Rectangle |
|
| 94 | + */ |
|
| 95 | + public function setBorderColor($borderColor) |
|
| 96 | + { |
|
| 97 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 98 | + return $this; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * @return string |
|
| 103 | + */ |
|
| 104 | + public function getBorderSkipped() |
|
| 105 | + { |
|
| 106 | + return $this->borderSkipped; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * @param string $borderSkipped |
|
| 111 | + * @return Rectangle |
|
| 112 | + */ |
|
| 113 | + public function setBorderSkipped($borderSkipped) |
|
| 114 | + { |
|
| 115 | + $this->borderSkipped = is_null($borderSkipped) ? null : strval($borderSkipped); |
|
| 116 | + return $this; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * @return string |
|
| 123 | + * @throws \ReflectionException |
|
| 124 | + * @throws \Zend_Reflection_Exception |
|
| 125 | + */ |
|
| 126 | + public function jsonSerialize() |
|
| 127 | + { |
|
| 128 | + return Json::encode($this->getArrayCopy()); |
|
| 129 | + } |
|
| 130 | 130 | |
| 131 | 131 | } |
| 132 | 132 | \ No newline at end of file |
@@ -9,251 +9,251 @@ |
||
| 9 | 9 | |
| 10 | 10 | class Point implements ArraySerializableInterface, \JsonSerializable |
| 11 | 11 | { |
| 12 | - use ArraySerializable; |
|
| 13 | - |
|
| 14 | - const STYLE_CIRCLE = 'circle'; |
|
| 15 | - const STYLE_CROSS = 'cross'; |
|
| 16 | - const STYLE_CROSS_ROT = 'crossRot'; |
|
| 17 | - const STYLE_DASH = 'dash'; |
|
| 18 | - const STYLE_LINE = 'line'; |
|
| 19 | - const STYLE_RECT = 'rect'; |
|
| 20 | - const STYLE_RECT_ROUNDED = 'rectRounded'; |
|
| 21 | - const STYLE_RECT_ROT = 'rectRot'; |
|
| 22 | - const STYLE_RECT_STAR = 'star'; |
|
| 23 | - const STYLE_TRIANGLE = 'triangle'; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Point radius. |
|
| 27 | - * @default 3 |
|
| 28 | - * @var int |
|
| 29 | - */ |
|
| 30 | - private $radius; |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * Point style. |
|
| 34 | - * @default self::STYLE_CIRCLE |
|
| 35 | - * @var string |
|
| 36 | - */ |
|
| 37 | - private $pointStyle; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * Point rotation (in degrees). |
|
| 41 | - * @default 0 |
|
| 42 | - * @var int |
|
| 43 | - */ |
|
| 44 | - private $rotation; |
|
| 45 | - |
|
| 46 | - /** |
|
| 47 | - * Point fill color. |
|
| 48 | - * @default 'rgba(0,0,0,0.1)' |
|
| 49 | - * @var string |
|
| 50 | - */ |
|
| 51 | - private $backgroundColor; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Point stroke width. |
|
| 55 | - * @default 1 |
|
| 56 | - * @var int |
|
| 57 | - */ |
|
| 58 | - private $borderWidth; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * Point stroke color. |
|
| 62 | - * @default 'rgba(0,0,0,0.1)' |
|
| 63 | - * @var string |
|
| 64 | - */ |
|
| 65 | - private $borderColor; |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * Extra radius added to point radius for hit detection. |
|
| 69 | - * @default 1 |
|
| 70 | - * @var int |
|
| 71 | - */ |
|
| 72 | - private $hitRadius; |
|
| 73 | - |
|
| 74 | - /** |
|
| 75 | - * Point radius when hovered. |
|
| 76 | - * @default 4 |
|
| 77 | - * @var int |
|
| 78 | - */ |
|
| 79 | - private $hoverRadius; |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * Stroke width when hovered. |
|
| 83 | - * @default 1 |
|
| 84 | - * @var int |
|
| 85 | - */ |
|
| 86 | - private $hoverBorderWidth; |
|
| 87 | - |
|
| 88 | - /** |
|
| 89 | - * @return int |
|
| 90 | - */ |
|
| 91 | - public function getRadius() |
|
| 92 | - { |
|
| 93 | - return $this->radius; |
|
| 94 | - } |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * @param int $radius |
|
| 98 | - * @return Point |
|
| 99 | - */ |
|
| 100 | - public function setRadius($radius) |
|
| 101 | - { |
|
| 102 | - $this->radius = intval($radius); |
|
| 103 | - return $this; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * @return string |
|
| 108 | - */ |
|
| 109 | - public function getPointStyle() |
|
| 110 | - { |
|
| 111 | - return $this->pointStyle; |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * @param string $pointStyle |
|
| 116 | - * @return Point |
|
| 117 | - */ |
|
| 118 | - public function setPointStyle($pointStyle) |
|
| 119 | - { |
|
| 120 | - $this->pointStyle = is_null($pointStyle) ? null : strval($pointStyle); |
|
| 121 | - return $this; |
|
| 122 | - } |
|
| 123 | - |
|
| 124 | - /** |
|
| 125 | - * @return int |
|
| 126 | - */ |
|
| 127 | - public function getRotation() |
|
| 128 | - { |
|
| 129 | - return $this->rotation; |
|
| 130 | - } |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * @param int $rotation |
|
| 134 | - * @return Point |
|
| 135 | - */ |
|
| 136 | - public function setRotation($rotation) |
|
| 137 | - { |
|
| 138 | - $this->rotation = intval($rotation); |
|
| 139 | - return $this; |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * @return string |
|
| 144 | - */ |
|
| 145 | - public function getBackgroundColor() |
|
| 146 | - { |
|
| 147 | - return $this->backgroundColor; |
|
| 148 | - } |
|
| 149 | - |
|
| 150 | - /** |
|
| 151 | - * @param string $backgroundColor |
|
| 152 | - * @return Point |
|
| 153 | - */ |
|
| 154 | - public function setBackgroundColor($backgroundColor) |
|
| 155 | - { |
|
| 156 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 157 | - return $this; |
|
| 158 | - } |
|
| 159 | - |
|
| 160 | - /** |
|
| 161 | - * @return int |
|
| 162 | - */ |
|
| 163 | - public function getBorderWidth() |
|
| 164 | - { |
|
| 165 | - return $this->borderWidth; |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - /** |
|
| 169 | - * @param int $borderWidth |
|
| 170 | - * @return Point |
|
| 171 | - */ |
|
| 172 | - public function setBorderWidth($borderWidth) |
|
| 173 | - { |
|
| 174 | - $this->borderWidth = intval($borderWidth); |
|
| 175 | - return $this; |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * @return string |
|
| 180 | - */ |
|
| 181 | - public function getBorderColor() |
|
| 182 | - { |
|
| 183 | - return $this->borderColor; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * @param string $borderColor |
|
| 188 | - * @return Point |
|
| 189 | - */ |
|
| 190 | - public function setBorderColor($borderColor) |
|
| 191 | - { |
|
| 192 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 193 | - return $this; |
|
| 194 | - } |
|
| 195 | - |
|
| 196 | - /** |
|
| 197 | - * @return int |
|
| 198 | - */ |
|
| 199 | - public function getHitRadius() |
|
| 200 | - { |
|
| 201 | - return $this->hitRadius; |
|
| 202 | - } |
|
| 203 | - |
|
| 204 | - /** |
|
| 205 | - * @param int $hitRadius |
|
| 206 | - * @return Point |
|
| 207 | - */ |
|
| 208 | - public function setHitRadius($hitRadius) |
|
| 209 | - { |
|
| 210 | - $this->hitRadius = intval($hitRadius); |
|
| 211 | - return $this; |
|
| 212 | - } |
|
| 213 | - |
|
| 214 | - /** |
|
| 215 | - * @return int |
|
| 216 | - */ |
|
| 217 | - public function getHoverRadius() |
|
| 218 | - { |
|
| 219 | - return $this->hoverRadius; |
|
| 220 | - } |
|
| 221 | - |
|
| 222 | - /** |
|
| 223 | - * @param int $hoverRadius |
|
| 224 | - * @return Point |
|
| 225 | - */ |
|
| 226 | - public function setHoverRadius($hoverRadius) |
|
| 227 | - { |
|
| 228 | - $this->hoverRadius = intval($hoverRadius); |
|
| 229 | - return $this; |
|
| 230 | - } |
|
| 231 | - |
|
| 232 | - /** |
|
| 233 | - * @return int |
|
| 234 | - */ |
|
| 235 | - public function getHoverBorderWidth() |
|
| 236 | - { |
|
| 237 | - return $this->hoverBorderWidth; |
|
| 238 | - } |
|
| 239 | - |
|
| 240 | - /** |
|
| 241 | - * @param int $hoverBorderWidth |
|
| 242 | - * @return Point |
|
| 243 | - */ |
|
| 244 | - public function setHoverBorderWidth($hoverBorderWidth) |
|
| 245 | - { |
|
| 246 | - $this->hoverBorderWidth = intval($hoverBorderWidth); |
|
| 247 | - return $this; |
|
| 248 | - } |
|
| 249 | - |
|
| 250 | - /** |
|
| 251 | - * @return string |
|
| 252 | - * @throws \ReflectionException |
|
| 253 | - * @throws \Zend_Reflection_Exception |
|
| 254 | - */ |
|
| 255 | - public function jsonSerialize() |
|
| 256 | - { |
|
| 257 | - return Json::encode($this->getArrayCopy()); |
|
| 258 | - } |
|
| 12 | + use ArraySerializable; |
|
| 13 | + |
|
| 14 | + const STYLE_CIRCLE = 'circle'; |
|
| 15 | + const STYLE_CROSS = 'cross'; |
|
| 16 | + const STYLE_CROSS_ROT = 'crossRot'; |
|
| 17 | + const STYLE_DASH = 'dash'; |
|
| 18 | + const STYLE_LINE = 'line'; |
|
| 19 | + const STYLE_RECT = 'rect'; |
|
| 20 | + const STYLE_RECT_ROUNDED = 'rectRounded'; |
|
| 21 | + const STYLE_RECT_ROT = 'rectRot'; |
|
| 22 | + const STYLE_RECT_STAR = 'star'; |
|
| 23 | + const STYLE_TRIANGLE = 'triangle'; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * Point radius. |
|
| 27 | + * @default 3 |
|
| 28 | + * @var int |
|
| 29 | + */ |
|
| 30 | + private $radius; |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * Point style. |
|
| 34 | + * @default self::STYLE_CIRCLE |
|
| 35 | + * @var string |
|
| 36 | + */ |
|
| 37 | + private $pointStyle; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * Point rotation (in degrees). |
|
| 41 | + * @default 0 |
|
| 42 | + * @var int |
|
| 43 | + */ |
|
| 44 | + private $rotation; |
|
| 45 | + |
|
| 46 | + /** |
|
| 47 | + * Point fill color. |
|
| 48 | + * @default 'rgba(0,0,0,0.1)' |
|
| 49 | + * @var string |
|
| 50 | + */ |
|
| 51 | + private $backgroundColor; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Point stroke width. |
|
| 55 | + * @default 1 |
|
| 56 | + * @var int |
|
| 57 | + */ |
|
| 58 | + private $borderWidth; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * Point stroke color. |
|
| 62 | + * @default 'rgba(0,0,0,0.1)' |
|
| 63 | + * @var string |
|
| 64 | + */ |
|
| 65 | + private $borderColor; |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * Extra radius added to point radius for hit detection. |
|
| 69 | + * @default 1 |
|
| 70 | + * @var int |
|
| 71 | + */ |
|
| 72 | + private $hitRadius; |
|
| 73 | + |
|
| 74 | + /** |
|
| 75 | + * Point radius when hovered. |
|
| 76 | + * @default 4 |
|
| 77 | + * @var int |
|
| 78 | + */ |
|
| 79 | + private $hoverRadius; |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * Stroke width when hovered. |
|
| 83 | + * @default 1 |
|
| 84 | + * @var int |
|
| 85 | + */ |
|
| 86 | + private $hoverBorderWidth; |
|
| 87 | + |
|
| 88 | + /** |
|
| 89 | + * @return int |
|
| 90 | + */ |
|
| 91 | + public function getRadius() |
|
| 92 | + { |
|
| 93 | + return $this->radius; |
|
| 94 | + } |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * @param int $radius |
|
| 98 | + * @return Point |
|
| 99 | + */ |
|
| 100 | + public function setRadius($radius) |
|
| 101 | + { |
|
| 102 | + $this->radius = intval($radius); |
|
| 103 | + return $this; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * @return string |
|
| 108 | + */ |
|
| 109 | + public function getPointStyle() |
|
| 110 | + { |
|
| 111 | + return $this->pointStyle; |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * @param string $pointStyle |
|
| 116 | + * @return Point |
|
| 117 | + */ |
|
| 118 | + public function setPointStyle($pointStyle) |
|
| 119 | + { |
|
| 120 | + $this->pointStyle = is_null($pointStyle) ? null : strval($pointStyle); |
|
| 121 | + return $this; |
|
| 122 | + } |
|
| 123 | + |
|
| 124 | + /** |
|
| 125 | + * @return int |
|
| 126 | + */ |
|
| 127 | + public function getRotation() |
|
| 128 | + { |
|
| 129 | + return $this->rotation; |
|
| 130 | + } |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * @param int $rotation |
|
| 134 | + * @return Point |
|
| 135 | + */ |
|
| 136 | + public function setRotation($rotation) |
|
| 137 | + { |
|
| 138 | + $this->rotation = intval($rotation); |
|
| 139 | + return $this; |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * @return string |
|
| 144 | + */ |
|
| 145 | + public function getBackgroundColor() |
|
| 146 | + { |
|
| 147 | + return $this->backgroundColor; |
|
| 148 | + } |
|
| 149 | + |
|
| 150 | + /** |
|
| 151 | + * @param string $backgroundColor |
|
| 152 | + * @return Point |
|
| 153 | + */ |
|
| 154 | + public function setBackgroundColor($backgroundColor) |
|
| 155 | + { |
|
| 156 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 157 | + return $this; |
|
| 158 | + } |
|
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * @return int |
|
| 162 | + */ |
|
| 163 | + public function getBorderWidth() |
|
| 164 | + { |
|
| 165 | + return $this->borderWidth; |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + /** |
|
| 169 | + * @param int $borderWidth |
|
| 170 | + * @return Point |
|
| 171 | + */ |
|
| 172 | + public function setBorderWidth($borderWidth) |
|
| 173 | + { |
|
| 174 | + $this->borderWidth = intval($borderWidth); |
|
| 175 | + return $this; |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * @return string |
|
| 180 | + */ |
|
| 181 | + public function getBorderColor() |
|
| 182 | + { |
|
| 183 | + return $this->borderColor; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * @param string $borderColor |
|
| 188 | + * @return Point |
|
| 189 | + */ |
|
| 190 | + public function setBorderColor($borderColor) |
|
| 191 | + { |
|
| 192 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 193 | + return $this; |
|
| 194 | + } |
|
| 195 | + |
|
| 196 | + /** |
|
| 197 | + * @return int |
|
| 198 | + */ |
|
| 199 | + public function getHitRadius() |
|
| 200 | + { |
|
| 201 | + return $this->hitRadius; |
|
| 202 | + } |
|
| 203 | + |
|
| 204 | + /** |
|
| 205 | + * @param int $hitRadius |
|
| 206 | + * @return Point |
|
| 207 | + */ |
|
| 208 | + public function setHitRadius($hitRadius) |
|
| 209 | + { |
|
| 210 | + $this->hitRadius = intval($hitRadius); |
|
| 211 | + return $this; |
|
| 212 | + } |
|
| 213 | + |
|
| 214 | + /** |
|
| 215 | + * @return int |
|
| 216 | + */ |
|
| 217 | + public function getHoverRadius() |
|
| 218 | + { |
|
| 219 | + return $this->hoverRadius; |
|
| 220 | + } |
|
| 221 | + |
|
| 222 | + /** |
|
| 223 | + * @param int $hoverRadius |
|
| 224 | + * @return Point |
|
| 225 | + */ |
|
| 226 | + public function setHoverRadius($hoverRadius) |
|
| 227 | + { |
|
| 228 | + $this->hoverRadius = intval($hoverRadius); |
|
| 229 | + return $this; |
|
| 230 | + } |
|
| 231 | + |
|
| 232 | + /** |
|
| 233 | + * @return int |
|
| 234 | + */ |
|
| 235 | + public function getHoverBorderWidth() |
|
| 236 | + { |
|
| 237 | + return $this->hoverBorderWidth; |
|
| 238 | + } |
|
| 239 | + |
|
| 240 | + /** |
|
| 241 | + * @param int $hoverBorderWidth |
|
| 242 | + * @return Point |
|
| 243 | + */ |
|
| 244 | + public function setHoverBorderWidth($hoverBorderWidth) |
|
| 245 | + { |
|
| 246 | + $this->hoverBorderWidth = intval($hoverBorderWidth); |
|
| 247 | + return $this; |
|
| 248 | + } |
|
| 249 | + |
|
| 250 | + /** |
|
| 251 | + * @return string |
|
| 252 | + * @throws \ReflectionException |
|
| 253 | + * @throws \Zend_Reflection_Exception |
|
| 254 | + */ |
|
| 255 | + public function jsonSerialize() |
|
| 256 | + { |
|
| 257 | + return Json::encode($this->getArrayCopy()); |
|
| 258 | + } |
|
| 259 | 259 | } |
| 260 | 260 | \ No newline at end of file |
@@ -19,150 +19,150 @@ |
||
| 19 | 19 | */ |
| 20 | 20 | class Options implements ChartOwnedInterface, ArraySerializableInterface, \JsonSerializable |
| 21 | 21 | { |
| 22 | - use ChartOwned; |
|
| 23 | - use ArraySerializable; |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * @var Layout |
|
| 27 | - */ |
|
| 28 | - protected $layout; |
|
| 29 | - |
|
| 30 | - /** |
|
| 31 | - * @var Title |
|
| 32 | - */ |
|
| 33 | - protected $title; |
|
| 34 | - |
|
| 35 | - /** |
|
| 36 | - * @var Elements |
|
| 37 | - */ |
|
| 38 | - protected $elements; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * @var Hover |
|
| 42 | - */ |
|
| 43 | - protected $hover; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * @var Scales |
|
| 47 | - */ |
|
| 48 | - protected $scales; |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @var Animation |
|
| 52 | - */ |
|
| 53 | - protected $animation; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * @var Legend |
|
| 57 | - */ |
|
| 58 | - protected $legend; |
|
| 59 | - |
|
| 60 | - /** |
|
| 61 | - * @var Tooltips |
|
| 62 | - */ |
|
| 63 | - protected $tooltips; |
|
| 64 | - |
|
| 65 | - /** |
|
| 66 | - * @return Layout |
|
| 67 | - */ |
|
| 68 | - public function getLayout() |
|
| 69 | - { |
|
| 70 | - if (is_null($this->layout)) { |
|
| 71 | - $this->layout = new Layout(); |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - return $this->layout; |
|
| 75 | - } |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * @return Elements |
|
| 79 | - */ |
|
| 80 | - public function getElements() |
|
| 81 | - { |
|
| 82 | - if (is_null($this->elements)) { |
|
| 83 | - $this->elements = new Elements(); |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - return $this->elements; |
|
| 87 | - } |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * @return Title |
|
| 91 | - */ |
|
| 92 | - public function getTitle() |
|
| 93 | - { |
|
| 94 | - if (is_null($this->title)) { |
|
| 95 | - $this->title = new Title(); |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - return $this->title; |
|
| 99 | - } |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * @return Hover |
|
| 103 | - */ |
|
| 104 | - public function getHover() |
|
| 105 | - { |
|
| 106 | - if (is_null($this->hover)) { |
|
| 107 | - $this->hover = new Hover(); |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - return $this->hover; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - /** |
|
| 114 | - * @return Scales |
|
| 115 | - */ |
|
| 116 | - public function getScales() |
|
| 117 | - { |
|
| 118 | - if (is_null($this->scales)) { |
|
| 119 | - $this->scales = new Scales(); |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - return $this->scales; |
|
| 123 | - } |
|
| 124 | - |
|
| 125 | - /** |
|
| 126 | - * @return Animation |
|
| 127 | - */ |
|
| 128 | - public function getAnimation() |
|
| 129 | - { |
|
| 130 | - if (is_null($this->animation)) { |
|
| 131 | - $this->animation = new Animation(); |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - return $this->animation; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - /** |
|
| 138 | - * @return Legend |
|
| 139 | - */ |
|
| 140 | - public function getLegend() |
|
| 141 | - { |
|
| 142 | - if (is_null($this->legend)) { |
|
| 143 | - $this->legend = new Legend(); |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - return $this->legend; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * @return Tooltips |
|
| 151 | - */ |
|
| 152 | - public function getTooltips() |
|
| 153 | - { |
|
| 154 | - if (is_null($this->tooltips)) { |
|
| 155 | - $this->tooltips = new Tooltips(); |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - return $this->tooltips; |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - /** |
|
| 162 | - * @return string |
|
| 163 | - */ |
|
| 164 | - public function jsonSerialize() |
|
| 165 | - { |
|
| 166 | - return Json::encode($this->getArrayCopy(), false, [ 'enableJsonExprFinder' => true ]); |
|
| 167 | - } |
|
| 22 | + use ChartOwned; |
|
| 23 | + use ArraySerializable; |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * @var Layout |
|
| 27 | + */ |
|
| 28 | + protected $layout; |
|
| 29 | + |
|
| 30 | + /** |
|
| 31 | + * @var Title |
|
| 32 | + */ |
|
| 33 | + protected $title; |
|
| 34 | + |
|
| 35 | + /** |
|
| 36 | + * @var Elements |
|
| 37 | + */ |
|
| 38 | + protected $elements; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @var Hover |
|
| 42 | + */ |
|
| 43 | + protected $hover; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * @var Scales |
|
| 47 | + */ |
|
| 48 | + protected $scales; |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @var Animation |
|
| 52 | + */ |
|
| 53 | + protected $animation; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * @var Legend |
|
| 57 | + */ |
|
| 58 | + protected $legend; |
|
| 59 | + |
|
| 60 | + /** |
|
| 61 | + * @var Tooltips |
|
| 62 | + */ |
|
| 63 | + protected $tooltips; |
|
| 64 | + |
|
| 65 | + /** |
|
| 66 | + * @return Layout |
|
| 67 | + */ |
|
| 68 | + public function getLayout() |
|
| 69 | + { |
|
| 70 | + if (is_null($this->layout)) { |
|
| 71 | + $this->layout = new Layout(); |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + return $this->layout; |
|
| 75 | + } |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * @return Elements |
|
| 79 | + */ |
|
| 80 | + public function getElements() |
|
| 81 | + { |
|
| 82 | + if (is_null($this->elements)) { |
|
| 83 | + $this->elements = new Elements(); |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + return $this->elements; |
|
| 87 | + } |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * @return Title |
|
| 91 | + */ |
|
| 92 | + public function getTitle() |
|
| 93 | + { |
|
| 94 | + if (is_null($this->title)) { |
|
| 95 | + $this->title = new Title(); |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + return $this->title; |
|
| 99 | + } |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * @return Hover |
|
| 103 | + */ |
|
| 104 | + public function getHover() |
|
| 105 | + { |
|
| 106 | + if (is_null($this->hover)) { |
|
| 107 | + $this->hover = new Hover(); |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + return $this->hover; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + /** |
|
| 114 | + * @return Scales |
|
| 115 | + */ |
|
| 116 | + public function getScales() |
|
| 117 | + { |
|
| 118 | + if (is_null($this->scales)) { |
|
| 119 | + $this->scales = new Scales(); |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + return $this->scales; |
|
| 123 | + } |
|
| 124 | + |
|
| 125 | + /** |
|
| 126 | + * @return Animation |
|
| 127 | + */ |
|
| 128 | + public function getAnimation() |
|
| 129 | + { |
|
| 130 | + if (is_null($this->animation)) { |
|
| 131 | + $this->animation = new Animation(); |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + return $this->animation; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + /** |
|
| 138 | + * @return Legend |
|
| 139 | + */ |
|
| 140 | + public function getLegend() |
|
| 141 | + { |
|
| 142 | + if (is_null($this->legend)) { |
|
| 143 | + $this->legend = new Legend(); |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + return $this->legend; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * @return Tooltips |
|
| 151 | + */ |
|
| 152 | + public function getTooltips() |
|
| 153 | + { |
|
| 154 | + if (is_null($this->tooltips)) { |
|
| 155 | + $this->tooltips = new Tooltips(); |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + return $this->tooltips; |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + /** |
|
| 162 | + * @return string |
|
| 163 | + */ |
|
| 164 | + public function jsonSerialize() |
|
| 165 | + { |
|
| 166 | + return Json::encode($this->getArrayCopy(), false, [ 'enableJsonExprFinder' => true ]); |
|
| 167 | + } |
|
| 168 | 168 | } |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | public function getLayout() |
| 69 | 69 | { |
| 70 | 70 | if (is_null($this->layout)) { |
| 71 | - $this->layout = new Layout(); |
|
| 71 | + $this->layout = new Layout(); |
|
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | return $this->layout; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | public function getElements() |
| 81 | 81 | { |
| 82 | 82 | if (is_null($this->elements)) { |
| 83 | - $this->elements = new Elements(); |
|
| 83 | + $this->elements = new Elements(); |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | return $this->elements; |