@@ -12,312 +12,312 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class Line implements ArraySerializableInterface, JsonSerializable |
| 14 | 14 | { |
| 15 | - use ArraySerializable; |
|
| 16 | - |
|
| 17 | - /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap */ |
|
| 18 | - const CAP_STYLE_BUTT = 'butt'; |
|
| 19 | - const CAP_STYLE_ROUND = 'round'; |
|
| 20 | - const CAP_STYLE_SQUARE = 'square'; |
|
| 21 | - |
|
| 22 | - /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin */ |
|
| 23 | - const JOIN_STYLE_ROUND = 'round'; |
|
| 24 | - const JOIN_STYLE_BEVEL = 'bevel'; |
|
| 25 | - const JOIN_STYLE_MITER = 'miter'; |
|
| 26 | - |
|
| 27 | - const FILL_LOCATION_ZERO = 'zero'; |
|
| 28 | - const FILL_LOCATION_TOP = 'top'; |
|
| 29 | - const FILL_LOCATION_BOTTOM = 'bottom'; |
|
| 30 | - const FILL_LOCATION_TRUE = true; |
|
| 31 | - const FILL_LOCATION_FALSE = false; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * Bézier curve tension (0 for no Bézier curves). |
|
| 35 | - * @default 0.4 |
|
| 36 | - * @var float |
|
| 37 | - */ |
|
| 38 | - private $tension; |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * Line fill color. |
|
| 42 | - * @default 'rgba(0,0,0,0.1)' |
|
| 43 | - * @var string |
|
| 44 | - */ |
|
| 45 | - private $backgroundColor; |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * Line stroke width. |
|
| 49 | - * @default 3 |
|
| 50 | - * @var int |
|
| 51 | - */ |
|
| 52 | - private $borderWidth; |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * Line stroke color. |
|
| 56 | - * @default 'rgba(0,0,0,0.1)' |
|
| 57 | - * @var string |
|
| 58 | - */ |
|
| 59 | - private $borderColor; |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * Line cap style. |
|
| 63 | - * @default self::CAP_STYLE_BUTT |
|
| 64 | - * @var string |
|
| 65 | - */ |
|
| 66 | - private $borderCapStyle; |
|
| 67 | - |
|
| 68 | - /** |
|
| 69 | - * Line dash. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash |
|
| 70 | - * @default [] |
|
| 71 | - * @var int[] |
|
| 72 | - */ |
|
| 73 | - private $borderDash; |
|
| 74 | - |
|
| 75 | - /** |
|
| 76 | - * Line dash offset. |
|
| 77 | - * @default 0 |
|
| 78 | - * @var float |
|
| 79 | - */ |
|
| 80 | - private $borderDashOffset; |
|
| 81 | - |
|
| 82 | - /** |
|
| 83 | - * Line join style. |
|
| 84 | - * @default self::JOIN_STYLE_MITER |
|
| 85 | - * @var string |
|
| 86 | - */ |
|
| 87 | - private $borderJoinStyle; |
|
| 88 | - |
|
| 89 | - /** |
|
| 90 | - * true to keep Bézier control inside the chart, false for no restriction. |
|
| 91 | - * @default true |
|
| 92 | - * @var bool |
|
| 93 | - */ |
|
| 94 | - private $capBezierPoints; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * Fill location: 'zero', 'top', 'bottom', true (eq. 'zero') or false (no fill). |
|
| 98 | - * @default self::FILL_LOCATION_TRUE |
|
| 99 | - * @var bool|string |
|
| 100 | - */ |
|
| 101 | - private $fill; |
|
| 102 | - |
|
| 103 | - /** |
|
| 104 | - * true to show the line as a stepped line (tension will be ignored). |
|
| 105 | - * @default false |
|
| 106 | - * @var bool |
|
| 107 | - */ |
|
| 108 | - private $stepped; |
|
| 109 | - |
|
| 110 | - /** |
|
| 111 | - * @return float |
|
| 112 | - */ |
|
| 113 | - public function getTension() |
|
| 114 | - { |
|
| 115 | - return $this->tension; |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - /** |
|
| 119 | - * @param float $tension |
|
| 120 | - * @return Line |
|
| 121 | - */ |
|
| 122 | - public function setTension($tension) |
|
| 123 | - { |
|
| 124 | - $this->tension = floatval($tension); |
|
| 125 | - return $this; |
|
| 126 | - } |
|
| 127 | - |
|
| 128 | - /** |
|
| 129 | - * @return string |
|
| 130 | - */ |
|
| 131 | - public function getBackgroundColor() |
|
| 132 | - { |
|
| 133 | - return $this->backgroundColor; |
|
| 134 | - } |
|
| 135 | - |
|
| 136 | - /** |
|
| 137 | - * @param string $backgroundColor |
|
| 138 | - * @return Line |
|
| 139 | - */ |
|
| 140 | - public function setBackgroundColor($backgroundColor) |
|
| 141 | - { |
|
| 142 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 143 | - return $this; |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - /** |
|
| 147 | - * @return int |
|
| 148 | - */ |
|
| 149 | - public function getBorderWidth() |
|
| 150 | - { |
|
| 151 | - return $this->borderWidth; |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - /** |
|
| 155 | - * @param int $borderWidth |
|
| 156 | - * @return Line |
|
| 157 | - */ |
|
| 158 | - public function setBorderWidth($borderWidth) |
|
| 159 | - { |
|
| 160 | - $this->borderWidth = intval($borderWidth); |
|
| 161 | - return $this; |
|
| 162 | - } |
|
| 163 | - |
|
| 164 | - /** |
|
| 165 | - * @return string |
|
| 166 | - */ |
|
| 167 | - public function getBorderColor() |
|
| 168 | - { |
|
| 169 | - return $this->borderColor; |
|
| 170 | - } |
|
| 171 | - |
|
| 172 | - /** |
|
| 173 | - * @param string $borderColor |
|
| 174 | - * @return Line |
|
| 175 | - */ |
|
| 176 | - public function setBorderColor($borderColor) |
|
| 177 | - { |
|
| 178 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 179 | - return $this; |
|
| 180 | - } |
|
| 181 | - |
|
| 182 | - /** |
|
| 183 | - * @return string |
|
| 184 | - */ |
|
| 185 | - public function getBorderCapStyle() |
|
| 186 | - { |
|
| 187 | - return $this->borderCapStyle; |
|
| 188 | - } |
|
| 189 | - |
|
| 190 | - /** |
|
| 191 | - * @param string $borderCapStyle |
|
| 192 | - * @return Line |
|
| 193 | - */ |
|
| 194 | - public function setBorderCapStyle($borderCapStyle) |
|
| 195 | - { |
|
| 196 | - $this->borderCapStyle = is_null($borderCapStyle) ? null : strval($borderCapStyle); |
|
| 197 | - return $this; |
|
| 198 | - } |
|
| 199 | - |
|
| 200 | - /** |
|
| 201 | - * @return int[] |
|
| 202 | - */ |
|
| 203 | - public function getBorderDash() |
|
| 204 | - { |
|
| 205 | - return $this->borderDash; |
|
| 206 | - } |
|
| 207 | - |
|
| 208 | - /** |
|
| 209 | - * @param int[] $borderDash |
|
| 210 | - * @return Line |
|
| 211 | - */ |
|
| 212 | - public function setBorderDash($borderDash) |
|
| 213 | - { |
|
| 214 | - if (is_array($borderDash)) { |
|
| 215 | - array_walk_recursive( |
|
| 216 | - $borderDash, |
|
| 217 | - function (&$value) { |
|
| 218 | - $value = intval($value); |
|
| 219 | - } |
|
| 220 | - ); |
|
| 221 | - $this->borderDash = $borderDash; |
|
| 222 | - } |
|
| 223 | - return $this; |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - /** |
|
| 227 | - * @return float |
|
| 228 | - */ |
|
| 229 | - public function getBorderDashOffset() |
|
| 230 | - { |
|
| 231 | - return $this->borderDashOffset; |
|
| 232 | - } |
|
| 233 | - |
|
| 234 | - /** |
|
| 235 | - * @param float $borderDashOffset |
|
| 236 | - * @return Line |
|
| 237 | - */ |
|
| 238 | - public function setBorderDashOffset($borderDashOffset) |
|
| 239 | - { |
|
| 240 | - $this->borderDashOffset = floatval($borderDashOffset); |
|
| 241 | - return $this; |
|
| 242 | - } |
|
| 243 | - |
|
| 244 | - /** |
|
| 245 | - * @return string |
|
| 246 | - */ |
|
| 247 | - public function getBorderJoinStyle() |
|
| 248 | - { |
|
| 249 | - return $this->borderJoinStyle; |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - /** |
|
| 253 | - * @param string $borderJoinStyle |
|
| 254 | - * @return Line |
|
| 255 | - */ |
|
| 256 | - public function setBorderJoinStyle($borderJoinStyle) |
|
| 257 | - { |
|
| 258 | - $this->borderJoinStyle = is_null($borderJoinStyle) ? null : strval($borderJoinStyle); |
|
| 259 | - return $this; |
|
| 260 | - } |
|
| 261 | - |
|
| 262 | - /** |
|
| 263 | - * @return bool |
|
| 264 | - */ |
|
| 265 | - public function isCapBezierPoints() |
|
| 266 | - { |
|
| 267 | - return $this->capBezierPoints; |
|
| 268 | - } |
|
| 269 | - |
|
| 270 | - /** |
|
| 271 | - * @param bool $capBezierPoints |
|
| 272 | - * @return Line |
|
| 273 | - */ |
|
| 274 | - public function setCapBezierPoints($capBezierPoints) |
|
| 275 | - { |
|
| 276 | - $this->capBezierPoints = boolval($capBezierPoints); |
|
| 277 | - return $this; |
|
| 278 | - } |
|
| 279 | - |
|
| 280 | - /** |
|
| 281 | - * @return bool|string |
|
| 282 | - */ |
|
| 283 | - public function getFill() |
|
| 284 | - { |
|
| 285 | - return $this->fill; |
|
| 286 | - } |
|
| 287 | - |
|
| 288 | - /** |
|
| 289 | - * @param bool|string $fill |
|
| 290 | - * @return Line |
|
| 291 | - */ |
|
| 292 | - public function setFill($fill) |
|
| 293 | - { |
|
| 294 | - $this->fill = is_null($fill) ? null : (is_bool($fill) ? $fill : strval($fill)); |
|
| 295 | - return $this; |
|
| 296 | - } |
|
| 297 | - |
|
| 298 | - /** |
|
| 299 | - * @return bool |
|
| 300 | - */ |
|
| 301 | - public function isStepped() |
|
| 302 | - { |
|
| 303 | - return $this->stepped; |
|
| 304 | - } |
|
| 305 | - |
|
| 306 | - /** |
|
| 307 | - * @param bool $stepped |
|
| 308 | - * @return Line |
|
| 309 | - */ |
|
| 310 | - public function setStepped($stepped) |
|
| 311 | - { |
|
| 312 | - $this->stepped = boolval($stepped); |
|
| 313 | - return $this; |
|
| 314 | - } |
|
| 315 | - |
|
| 316 | - /** |
|
| 317 | - * @return array |
|
| 318 | - */ |
|
| 319 | - public function jsonSerialize() |
|
| 320 | - { |
|
| 321 | - return $this->getArrayCopy(); |
|
| 322 | - } |
|
| 15 | + use ArraySerializable; |
|
| 16 | + |
|
| 17 | + /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap */ |
|
| 18 | + const CAP_STYLE_BUTT = 'butt'; |
|
| 19 | + const CAP_STYLE_ROUND = 'round'; |
|
| 20 | + const CAP_STYLE_SQUARE = 'square'; |
|
| 21 | + |
|
| 22 | + /** https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin */ |
|
| 23 | + const JOIN_STYLE_ROUND = 'round'; |
|
| 24 | + const JOIN_STYLE_BEVEL = 'bevel'; |
|
| 25 | + const JOIN_STYLE_MITER = 'miter'; |
|
| 26 | + |
|
| 27 | + const FILL_LOCATION_ZERO = 'zero'; |
|
| 28 | + const FILL_LOCATION_TOP = 'top'; |
|
| 29 | + const FILL_LOCATION_BOTTOM = 'bottom'; |
|
| 30 | + const FILL_LOCATION_TRUE = true; |
|
| 31 | + const FILL_LOCATION_FALSE = false; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * Bézier curve tension (0 for no Bézier curves). |
|
| 35 | + * @default 0.4 |
|
| 36 | + * @var float |
|
| 37 | + */ |
|
| 38 | + private $tension; |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * Line fill color. |
|
| 42 | + * @default 'rgba(0,0,0,0.1)' |
|
| 43 | + * @var string |
|
| 44 | + */ |
|
| 45 | + private $backgroundColor; |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * Line stroke width. |
|
| 49 | + * @default 3 |
|
| 50 | + * @var int |
|
| 51 | + */ |
|
| 52 | + private $borderWidth; |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * Line stroke color. |
|
| 56 | + * @default 'rgba(0,0,0,0.1)' |
|
| 57 | + * @var string |
|
| 58 | + */ |
|
| 59 | + private $borderColor; |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * Line cap style. |
|
| 63 | + * @default self::CAP_STYLE_BUTT |
|
| 64 | + * @var string |
|
| 65 | + */ |
|
| 66 | + private $borderCapStyle; |
|
| 67 | + |
|
| 68 | + /** |
|
| 69 | + * Line dash. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash |
|
| 70 | + * @default [] |
|
| 71 | + * @var int[] |
|
| 72 | + */ |
|
| 73 | + private $borderDash; |
|
| 74 | + |
|
| 75 | + /** |
|
| 76 | + * Line dash offset. |
|
| 77 | + * @default 0 |
|
| 78 | + * @var float |
|
| 79 | + */ |
|
| 80 | + private $borderDashOffset; |
|
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * Line join style. |
|
| 84 | + * @default self::JOIN_STYLE_MITER |
|
| 85 | + * @var string |
|
| 86 | + */ |
|
| 87 | + private $borderJoinStyle; |
|
| 88 | + |
|
| 89 | + /** |
|
| 90 | + * true to keep Bézier control inside the chart, false for no restriction. |
|
| 91 | + * @default true |
|
| 92 | + * @var bool |
|
| 93 | + */ |
|
| 94 | + private $capBezierPoints; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * Fill location: 'zero', 'top', 'bottom', true (eq. 'zero') or false (no fill). |
|
| 98 | + * @default self::FILL_LOCATION_TRUE |
|
| 99 | + * @var bool|string |
|
| 100 | + */ |
|
| 101 | + private $fill; |
|
| 102 | + |
|
| 103 | + /** |
|
| 104 | + * true to show the line as a stepped line (tension will be ignored). |
|
| 105 | + * @default false |
|
| 106 | + * @var bool |
|
| 107 | + */ |
|
| 108 | + private $stepped; |
|
| 109 | + |
|
| 110 | + /** |
|
| 111 | + * @return float |
|
| 112 | + */ |
|
| 113 | + public function getTension() |
|
| 114 | + { |
|
| 115 | + return $this->tension; |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + /** |
|
| 119 | + * @param float $tension |
|
| 120 | + * @return Line |
|
| 121 | + */ |
|
| 122 | + public function setTension($tension) |
|
| 123 | + { |
|
| 124 | + $this->tension = floatval($tension); |
|
| 125 | + return $this; |
|
| 126 | + } |
|
| 127 | + |
|
| 128 | + /** |
|
| 129 | + * @return string |
|
| 130 | + */ |
|
| 131 | + public function getBackgroundColor() |
|
| 132 | + { |
|
| 133 | + return $this->backgroundColor; |
|
| 134 | + } |
|
| 135 | + |
|
| 136 | + /** |
|
| 137 | + * @param string $backgroundColor |
|
| 138 | + * @return Line |
|
| 139 | + */ |
|
| 140 | + public function setBackgroundColor($backgroundColor) |
|
| 141 | + { |
|
| 142 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 143 | + return $this; |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + /** |
|
| 147 | + * @return int |
|
| 148 | + */ |
|
| 149 | + public function getBorderWidth() |
|
| 150 | + { |
|
| 151 | + return $this->borderWidth; |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + /** |
|
| 155 | + * @param int $borderWidth |
|
| 156 | + * @return Line |
|
| 157 | + */ |
|
| 158 | + public function setBorderWidth($borderWidth) |
|
| 159 | + { |
|
| 160 | + $this->borderWidth = intval($borderWidth); |
|
| 161 | + return $this; |
|
| 162 | + } |
|
| 163 | + |
|
| 164 | + /** |
|
| 165 | + * @return string |
|
| 166 | + */ |
|
| 167 | + public function getBorderColor() |
|
| 168 | + { |
|
| 169 | + return $this->borderColor; |
|
| 170 | + } |
|
| 171 | + |
|
| 172 | + /** |
|
| 173 | + * @param string $borderColor |
|
| 174 | + * @return Line |
|
| 175 | + */ |
|
| 176 | + public function setBorderColor($borderColor) |
|
| 177 | + { |
|
| 178 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 179 | + return $this; |
|
| 180 | + } |
|
| 181 | + |
|
| 182 | + /** |
|
| 183 | + * @return string |
|
| 184 | + */ |
|
| 185 | + public function getBorderCapStyle() |
|
| 186 | + { |
|
| 187 | + return $this->borderCapStyle; |
|
| 188 | + } |
|
| 189 | + |
|
| 190 | + /** |
|
| 191 | + * @param string $borderCapStyle |
|
| 192 | + * @return Line |
|
| 193 | + */ |
|
| 194 | + public function setBorderCapStyle($borderCapStyle) |
|
| 195 | + { |
|
| 196 | + $this->borderCapStyle = is_null($borderCapStyle) ? null : strval($borderCapStyle); |
|
| 197 | + return $this; |
|
| 198 | + } |
|
| 199 | + |
|
| 200 | + /** |
|
| 201 | + * @return int[] |
|
| 202 | + */ |
|
| 203 | + public function getBorderDash() |
|
| 204 | + { |
|
| 205 | + return $this->borderDash; |
|
| 206 | + } |
|
| 207 | + |
|
| 208 | + /** |
|
| 209 | + * @param int[] $borderDash |
|
| 210 | + * @return Line |
|
| 211 | + */ |
|
| 212 | + public function setBorderDash($borderDash) |
|
| 213 | + { |
|
| 214 | + if (is_array($borderDash)) { |
|
| 215 | + array_walk_recursive( |
|
| 216 | + $borderDash, |
|
| 217 | + function (&$value) { |
|
| 218 | + $value = intval($value); |
|
| 219 | + } |
|
| 220 | + ); |
|
| 221 | + $this->borderDash = $borderDash; |
|
| 222 | + } |
|
| 223 | + return $this; |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + /** |
|
| 227 | + * @return float |
|
| 228 | + */ |
|
| 229 | + public function getBorderDashOffset() |
|
| 230 | + { |
|
| 231 | + return $this->borderDashOffset; |
|
| 232 | + } |
|
| 233 | + |
|
| 234 | + /** |
|
| 235 | + * @param float $borderDashOffset |
|
| 236 | + * @return Line |
|
| 237 | + */ |
|
| 238 | + public function setBorderDashOffset($borderDashOffset) |
|
| 239 | + { |
|
| 240 | + $this->borderDashOffset = floatval($borderDashOffset); |
|
| 241 | + return $this; |
|
| 242 | + } |
|
| 243 | + |
|
| 244 | + /** |
|
| 245 | + * @return string |
|
| 246 | + */ |
|
| 247 | + public function getBorderJoinStyle() |
|
| 248 | + { |
|
| 249 | + return $this->borderJoinStyle; |
|
| 250 | + } |
|
| 251 | + |
|
| 252 | + /** |
|
| 253 | + * @param string $borderJoinStyle |
|
| 254 | + * @return Line |
|
| 255 | + */ |
|
| 256 | + public function setBorderJoinStyle($borderJoinStyle) |
|
| 257 | + { |
|
| 258 | + $this->borderJoinStyle = is_null($borderJoinStyle) ? null : strval($borderJoinStyle); |
|
| 259 | + return $this; |
|
| 260 | + } |
|
| 261 | + |
|
| 262 | + /** |
|
| 263 | + * @return bool |
|
| 264 | + */ |
|
| 265 | + public function isCapBezierPoints() |
|
| 266 | + { |
|
| 267 | + return $this->capBezierPoints; |
|
| 268 | + } |
|
| 269 | + |
|
| 270 | + /** |
|
| 271 | + * @param bool $capBezierPoints |
|
| 272 | + * @return Line |
|
| 273 | + */ |
|
| 274 | + public function setCapBezierPoints($capBezierPoints) |
|
| 275 | + { |
|
| 276 | + $this->capBezierPoints = boolval($capBezierPoints); |
|
| 277 | + return $this; |
|
| 278 | + } |
|
| 279 | + |
|
| 280 | + /** |
|
| 281 | + * @return bool|string |
|
| 282 | + */ |
|
| 283 | + public function getFill() |
|
| 284 | + { |
|
| 285 | + return $this->fill; |
|
| 286 | + } |
|
| 287 | + |
|
| 288 | + /** |
|
| 289 | + * @param bool|string $fill |
|
| 290 | + * @return Line |
|
| 291 | + */ |
|
| 292 | + public function setFill($fill) |
|
| 293 | + { |
|
| 294 | + $this->fill = is_null($fill) ? null : (is_bool($fill) ? $fill : strval($fill)); |
|
| 295 | + return $this; |
|
| 296 | + } |
|
| 297 | + |
|
| 298 | + /** |
|
| 299 | + * @return bool |
|
| 300 | + */ |
|
| 301 | + public function isStepped() |
|
| 302 | + { |
|
| 303 | + return $this->stepped; |
|
| 304 | + } |
|
| 305 | + |
|
| 306 | + /** |
|
| 307 | + * @param bool $stepped |
|
| 308 | + * @return Line |
|
| 309 | + */ |
|
| 310 | + public function setStepped($stepped) |
|
| 311 | + { |
|
| 312 | + $this->stepped = boolval($stepped); |
|
| 313 | + return $this; |
|
| 314 | + } |
|
| 315 | + |
|
| 316 | + /** |
|
| 317 | + * @return array |
|
| 318 | + */ |
|
| 319 | + public function jsonSerialize() |
|
| 320 | + { |
|
| 321 | + return $this->getArrayCopy(); |
|
| 322 | + } |
|
| 323 | 323 | } |
@@ -13,97 +13,97 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class Arc implements ArraySerializableInterface, JsonSerializable |
| 15 | 15 | { |
| 16 | - use ArraySerializable; |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * Arc fill color. |
|
| 20 | - * |
|
| 21 | - * @default 'rgba(0,0,0,0.1)' |
|
| 22 | - * @var string |
|
| 23 | - */ |
|
| 24 | - private $backgroundColor; |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * Arc stroke color. |
|
| 28 | - * |
|
| 29 | - * @default '#fff' |
|
| 30 | - * @var string |
|
| 31 | - */ |
|
| 32 | - private $borderColor; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * Arc stroke width. |
|
| 36 | - * |
|
| 37 | - * @default 2 |
|
| 38 | - * @var int |
|
| 39 | - */ |
|
| 40 | - private $borderWidth; |
|
| 41 | - |
|
| 42 | - /** |
|
| 43 | - * @return string |
|
| 44 | - */ |
|
| 45 | - public function getBackgroundColor() |
|
| 46 | - { |
|
| 47 | - return $this->backgroundColor; |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - /** |
|
| 51 | - * @param string $backgroundColor |
|
| 52 | - * |
|
| 53 | - * @return Arc |
|
| 54 | - */ |
|
| 55 | - public function setBackgroundColor($backgroundColor) |
|
| 56 | - { |
|
| 57 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 58 | - |
|
| 59 | - return $this; |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * @return string |
|
| 64 | - */ |
|
| 65 | - public function getBorderColor() |
|
| 66 | - { |
|
| 67 | - return $this->borderColor; |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - /** |
|
| 71 | - * @param string $borderColor |
|
| 72 | - * |
|
| 73 | - * @return Arc |
|
| 74 | - */ |
|
| 75 | - public function setBorderColor($borderColor) |
|
| 76 | - { |
|
| 77 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 78 | - |
|
| 79 | - return $this; |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - /** |
|
| 83 | - * @return int |
|
| 84 | - */ |
|
| 85 | - public function getBorderWidth() |
|
| 86 | - { |
|
| 87 | - return $this->borderWidth; |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - /** |
|
| 91 | - * @param int $borderWidth |
|
| 92 | - * |
|
| 93 | - * @return Arc |
|
| 94 | - */ |
|
| 95 | - public function setBorderWidth($borderWidth) |
|
| 96 | - { |
|
| 97 | - $this->borderWidth = intval($borderWidth); |
|
| 98 | - |
|
| 99 | - return $this; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * @return array |
|
| 104 | - */ |
|
| 105 | - public function jsonSerialize() |
|
| 106 | - { |
|
| 107 | - return $this->getArrayCopy(); |
|
| 108 | - } |
|
| 16 | + use ArraySerializable; |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * Arc fill color. |
|
| 20 | + * |
|
| 21 | + * @default 'rgba(0,0,0,0.1)' |
|
| 22 | + * @var string |
|
| 23 | + */ |
|
| 24 | + private $backgroundColor; |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * Arc stroke color. |
|
| 28 | + * |
|
| 29 | + * @default '#fff' |
|
| 30 | + * @var string |
|
| 31 | + */ |
|
| 32 | + private $borderColor; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * Arc stroke width. |
|
| 36 | + * |
|
| 37 | + * @default 2 |
|
| 38 | + * @var int |
|
| 39 | + */ |
|
| 40 | + private $borderWidth; |
|
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * @return string |
|
| 44 | + */ |
|
| 45 | + public function getBackgroundColor() |
|
| 46 | + { |
|
| 47 | + return $this->backgroundColor; |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + /** |
|
| 51 | + * @param string $backgroundColor |
|
| 52 | + * |
|
| 53 | + * @return Arc |
|
| 54 | + */ |
|
| 55 | + public function setBackgroundColor($backgroundColor) |
|
| 56 | + { |
|
| 57 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 58 | + |
|
| 59 | + return $this; |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * @return string |
|
| 64 | + */ |
|
| 65 | + public function getBorderColor() |
|
| 66 | + { |
|
| 67 | + return $this->borderColor; |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + /** |
|
| 71 | + * @param string $borderColor |
|
| 72 | + * |
|
| 73 | + * @return Arc |
|
| 74 | + */ |
|
| 75 | + public function setBorderColor($borderColor) |
|
| 76 | + { |
|
| 77 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 78 | + |
|
| 79 | + return $this; |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * @return int |
|
| 84 | + */ |
|
| 85 | + public function getBorderWidth() |
|
| 86 | + { |
|
| 87 | + return $this->borderWidth; |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + /** |
|
| 91 | + * @param int $borderWidth |
|
| 92 | + * |
|
| 93 | + * @return Arc |
|
| 94 | + */ |
|
| 95 | + public function setBorderWidth($borderWidth) |
|
| 96 | + { |
|
| 97 | + $this->borderWidth = intval($borderWidth); |
|
| 98 | + |
|
| 99 | + return $this; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @return array |
|
| 104 | + */ |
|
| 105 | + public function jsonSerialize() |
|
| 106 | + { |
|
| 107 | + return $this->getArrayCopy(); |
|
| 108 | + } |
|
| 109 | 109 | } |
@@ -13,276 +13,276 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class Point implements ArraySerializableInterface, JsonSerializable |
| 15 | 15 | { |
| 16 | - use ArraySerializable; |
|
| 17 | - |
|
| 18 | - const STYLE_CIRCLE = 'circle'; |
|
| 19 | - const STYLE_CROSS = 'cross'; |
|
| 20 | - const STYLE_CROSS_ROT = 'crossRot'; |
|
| 21 | - const STYLE_DASH = 'dash'; |
|
| 22 | - const STYLE_LINE = 'line'; |
|
| 23 | - const STYLE_RECT = 'rect'; |
|
| 24 | - const STYLE_RECT_ROUNDED = 'rectRounded'; |
|
| 25 | - const STYLE_RECT_ROT = 'rectRot'; |
|
| 26 | - const STYLE_RECT_STAR = 'star'; |
|
| 27 | - const STYLE_TRIANGLE = 'triangle'; |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * Point radius. |
|
| 31 | - * |
|
| 32 | - * @default 3 |
|
| 33 | - * @var int |
|
| 34 | - */ |
|
| 35 | - private $radius; |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * Point style. |
|
| 39 | - * |
|
| 40 | - * @default self::STYLE_CIRCLE |
|
| 41 | - * @var string |
|
| 42 | - */ |
|
| 43 | - private $pointStyle; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * Point rotation (in degrees). |
|
| 47 | - * |
|
| 48 | - * @default 0 |
|
| 49 | - * @var int |
|
| 50 | - */ |
|
| 51 | - private $rotation; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * Point fill color. |
|
| 55 | - * |
|
| 56 | - * @default 'rgba(0,0,0,0.1)' |
|
| 57 | - * @var string |
|
| 58 | - */ |
|
| 59 | - private $backgroundColor; |
|
| 60 | - |
|
| 61 | - /** |
|
| 62 | - * Point stroke width. |
|
| 63 | - * |
|
| 64 | - * @default 1 |
|
| 65 | - * @var int |
|
| 66 | - */ |
|
| 67 | - private $borderWidth; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * Point stroke color. |
|
| 71 | - * |
|
| 72 | - * @default 'rgba(0,0,0,0.1)' |
|
| 73 | - * @var string |
|
| 74 | - */ |
|
| 75 | - private $borderColor; |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * Extra radius added to point radius for hit detection. |
|
| 79 | - * |
|
| 80 | - * @default 1 |
|
| 81 | - * @var int |
|
| 82 | - */ |
|
| 83 | - private $hitRadius; |
|
| 84 | - |
|
| 85 | - /** |
|
| 86 | - * Point radius when hovered. |
|
| 87 | - * |
|
| 88 | - * @default 4 |
|
| 89 | - * @var int |
|
| 90 | - */ |
|
| 91 | - private $hoverRadius; |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * Stroke width when hovered. |
|
| 95 | - * |
|
| 96 | - * @default 1 |
|
| 97 | - * @var int |
|
| 98 | - */ |
|
| 99 | - private $hoverBorderWidth; |
|
| 100 | - |
|
| 101 | - /** |
|
| 102 | - * @return int |
|
| 103 | - */ |
|
| 104 | - public function getRadius() |
|
| 105 | - { |
|
| 106 | - return $this->radius; |
|
| 107 | - } |
|
| 108 | - |
|
| 109 | - /** |
|
| 110 | - * @param int $radius |
|
| 111 | - * |
|
| 112 | - * @return Point |
|
| 113 | - */ |
|
| 114 | - public function setRadius($radius) |
|
| 115 | - { |
|
| 116 | - $this->radius = intval($radius); |
|
| 117 | - |
|
| 118 | - return $this; |
|
| 119 | - } |
|
| 120 | - |
|
| 121 | - /** |
|
| 122 | - * @return string |
|
| 123 | - */ |
|
| 124 | - public function getPointStyle() |
|
| 125 | - { |
|
| 126 | - return $this->pointStyle; |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - /** |
|
| 130 | - * @param string $pointStyle |
|
| 131 | - * |
|
| 132 | - * @return Point |
|
| 133 | - */ |
|
| 134 | - public function setPointStyle($pointStyle) |
|
| 135 | - { |
|
| 136 | - $this->pointStyle = is_null($pointStyle) ? null : strval($pointStyle); |
|
| 137 | - |
|
| 138 | - return $this; |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * @return int |
|
| 143 | - */ |
|
| 144 | - public function getRotation() |
|
| 145 | - { |
|
| 146 | - return $this->rotation; |
|
| 147 | - } |
|
| 148 | - |
|
| 149 | - /** |
|
| 150 | - * @param int $rotation |
|
| 151 | - * |
|
| 152 | - * @return Point |
|
| 153 | - */ |
|
| 154 | - public function setRotation($rotation) |
|
| 155 | - { |
|
| 156 | - $this->rotation = intval($rotation); |
|
| 157 | - |
|
| 158 | - return $this; |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - /** |
|
| 162 | - * @return string |
|
| 163 | - */ |
|
| 164 | - public function getBackgroundColor() |
|
| 165 | - { |
|
| 166 | - return $this->backgroundColor; |
|
| 167 | - } |
|
| 168 | - |
|
| 169 | - /** |
|
| 170 | - * @param string $backgroundColor |
|
| 171 | - * |
|
| 172 | - * @return Point |
|
| 173 | - */ |
|
| 174 | - public function setBackgroundColor($backgroundColor) |
|
| 175 | - { |
|
| 176 | - $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 177 | - |
|
| 178 | - return $this; |
|
| 179 | - } |
|
| 180 | - |
|
| 181 | - /** |
|
| 182 | - * @return int |
|
| 183 | - */ |
|
| 184 | - public function getBorderWidth() |
|
| 185 | - { |
|
| 186 | - return $this->borderWidth; |
|
| 187 | - } |
|
| 188 | - |
|
| 189 | - /** |
|
| 190 | - * @param int $borderWidth |
|
| 191 | - * |
|
| 192 | - * @return Point |
|
| 193 | - */ |
|
| 194 | - public function setBorderWidth($borderWidth) |
|
| 195 | - { |
|
| 196 | - $this->borderWidth = intval($borderWidth); |
|
| 197 | - |
|
| 198 | - return $this; |
|
| 199 | - } |
|
| 200 | - |
|
| 201 | - /** |
|
| 202 | - * @return string |
|
| 203 | - */ |
|
| 204 | - public function getBorderColor() |
|
| 205 | - { |
|
| 206 | - return $this->borderColor; |
|
| 207 | - } |
|
| 208 | - |
|
| 209 | - /** |
|
| 210 | - * @param string $borderColor |
|
| 211 | - * |
|
| 212 | - * @return Point |
|
| 213 | - */ |
|
| 214 | - public function setBorderColor($borderColor) |
|
| 215 | - { |
|
| 216 | - $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 217 | - |
|
| 218 | - return $this; |
|
| 219 | - } |
|
| 220 | - |
|
| 221 | - /** |
|
| 222 | - * @return int |
|
| 223 | - */ |
|
| 224 | - public function getHitRadius() |
|
| 225 | - { |
|
| 226 | - return $this->hitRadius; |
|
| 227 | - } |
|
| 228 | - |
|
| 229 | - /** |
|
| 230 | - * @param int $hitRadius |
|
| 231 | - * |
|
| 232 | - * @return Point |
|
| 233 | - */ |
|
| 234 | - public function setHitRadius($hitRadius) |
|
| 235 | - { |
|
| 236 | - $this->hitRadius = intval($hitRadius); |
|
| 237 | - |
|
| 238 | - return $this; |
|
| 239 | - } |
|
| 240 | - |
|
| 241 | - /** |
|
| 242 | - * @return int |
|
| 243 | - */ |
|
| 244 | - public function getHoverRadius() |
|
| 245 | - { |
|
| 246 | - return $this->hoverRadius; |
|
| 247 | - } |
|
| 248 | - |
|
| 249 | - /** |
|
| 250 | - * @param int $hoverRadius |
|
| 251 | - * |
|
| 252 | - * @return Point |
|
| 253 | - */ |
|
| 254 | - public function setHoverRadius($hoverRadius) |
|
| 255 | - { |
|
| 256 | - $this->hoverRadius = intval($hoverRadius); |
|
| 257 | - |
|
| 258 | - return $this; |
|
| 259 | - } |
|
| 260 | - |
|
| 261 | - /** |
|
| 262 | - * @return int |
|
| 263 | - */ |
|
| 264 | - public function getHoverBorderWidth() |
|
| 265 | - { |
|
| 266 | - return $this->hoverBorderWidth; |
|
| 267 | - } |
|
| 268 | - |
|
| 269 | - /** |
|
| 270 | - * @param int $hoverBorderWidth |
|
| 271 | - * |
|
| 272 | - * @return Point |
|
| 273 | - */ |
|
| 274 | - public function setHoverBorderWidth($hoverBorderWidth) |
|
| 275 | - { |
|
| 276 | - $this->hoverBorderWidth = intval($hoverBorderWidth); |
|
| 277 | - |
|
| 278 | - return $this; |
|
| 279 | - } |
|
| 280 | - |
|
| 281 | - /** |
|
| 282 | - * @return array |
|
| 283 | - */ |
|
| 284 | - public function jsonSerialize() |
|
| 285 | - { |
|
| 286 | - return $this->getArrayCopy(); |
|
| 287 | - } |
|
| 16 | + use ArraySerializable; |
|
| 17 | + |
|
| 18 | + const STYLE_CIRCLE = 'circle'; |
|
| 19 | + const STYLE_CROSS = 'cross'; |
|
| 20 | + const STYLE_CROSS_ROT = 'crossRot'; |
|
| 21 | + const STYLE_DASH = 'dash'; |
|
| 22 | + const STYLE_LINE = 'line'; |
|
| 23 | + const STYLE_RECT = 'rect'; |
|
| 24 | + const STYLE_RECT_ROUNDED = 'rectRounded'; |
|
| 25 | + const STYLE_RECT_ROT = 'rectRot'; |
|
| 26 | + const STYLE_RECT_STAR = 'star'; |
|
| 27 | + const STYLE_TRIANGLE = 'triangle'; |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * Point radius. |
|
| 31 | + * |
|
| 32 | + * @default 3 |
|
| 33 | + * @var int |
|
| 34 | + */ |
|
| 35 | + private $radius; |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * Point style. |
|
| 39 | + * |
|
| 40 | + * @default self::STYLE_CIRCLE |
|
| 41 | + * @var string |
|
| 42 | + */ |
|
| 43 | + private $pointStyle; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * Point rotation (in degrees). |
|
| 47 | + * |
|
| 48 | + * @default 0 |
|
| 49 | + * @var int |
|
| 50 | + */ |
|
| 51 | + private $rotation; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * Point fill color. |
|
| 55 | + * |
|
| 56 | + * @default 'rgba(0,0,0,0.1)' |
|
| 57 | + * @var string |
|
| 58 | + */ |
|
| 59 | + private $backgroundColor; |
|
| 60 | + |
|
| 61 | + /** |
|
| 62 | + * Point stroke width. |
|
| 63 | + * |
|
| 64 | + * @default 1 |
|
| 65 | + * @var int |
|
| 66 | + */ |
|
| 67 | + private $borderWidth; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * Point stroke color. |
|
| 71 | + * |
|
| 72 | + * @default 'rgba(0,0,0,0.1)' |
|
| 73 | + * @var string |
|
| 74 | + */ |
|
| 75 | + private $borderColor; |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * Extra radius added to point radius for hit detection. |
|
| 79 | + * |
|
| 80 | + * @default 1 |
|
| 81 | + * @var int |
|
| 82 | + */ |
|
| 83 | + private $hitRadius; |
|
| 84 | + |
|
| 85 | + /** |
|
| 86 | + * Point radius when hovered. |
|
| 87 | + * |
|
| 88 | + * @default 4 |
|
| 89 | + * @var int |
|
| 90 | + */ |
|
| 91 | + private $hoverRadius; |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * Stroke width when hovered. |
|
| 95 | + * |
|
| 96 | + * @default 1 |
|
| 97 | + * @var int |
|
| 98 | + */ |
|
| 99 | + private $hoverBorderWidth; |
|
| 100 | + |
|
| 101 | + /** |
|
| 102 | + * @return int |
|
| 103 | + */ |
|
| 104 | + public function getRadius() |
|
| 105 | + { |
|
| 106 | + return $this->radius; |
|
| 107 | + } |
|
| 108 | + |
|
| 109 | + /** |
|
| 110 | + * @param int $radius |
|
| 111 | + * |
|
| 112 | + * @return Point |
|
| 113 | + */ |
|
| 114 | + public function setRadius($radius) |
|
| 115 | + { |
|
| 116 | + $this->radius = intval($radius); |
|
| 117 | + |
|
| 118 | + return $this; |
|
| 119 | + } |
|
| 120 | + |
|
| 121 | + /** |
|
| 122 | + * @return string |
|
| 123 | + */ |
|
| 124 | + public function getPointStyle() |
|
| 125 | + { |
|
| 126 | + return $this->pointStyle; |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + /** |
|
| 130 | + * @param string $pointStyle |
|
| 131 | + * |
|
| 132 | + * @return Point |
|
| 133 | + */ |
|
| 134 | + public function setPointStyle($pointStyle) |
|
| 135 | + { |
|
| 136 | + $this->pointStyle = is_null($pointStyle) ? null : strval($pointStyle); |
|
| 137 | + |
|
| 138 | + return $this; |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * @return int |
|
| 143 | + */ |
|
| 144 | + public function getRotation() |
|
| 145 | + { |
|
| 146 | + return $this->rotation; |
|
| 147 | + } |
|
| 148 | + |
|
| 149 | + /** |
|
| 150 | + * @param int $rotation |
|
| 151 | + * |
|
| 152 | + * @return Point |
|
| 153 | + */ |
|
| 154 | + public function setRotation($rotation) |
|
| 155 | + { |
|
| 156 | + $this->rotation = intval($rotation); |
|
| 157 | + |
|
| 158 | + return $this; |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + /** |
|
| 162 | + * @return string |
|
| 163 | + */ |
|
| 164 | + public function getBackgroundColor() |
|
| 165 | + { |
|
| 166 | + return $this->backgroundColor; |
|
| 167 | + } |
|
| 168 | + |
|
| 169 | + /** |
|
| 170 | + * @param string $backgroundColor |
|
| 171 | + * |
|
| 172 | + * @return Point |
|
| 173 | + */ |
|
| 174 | + public function setBackgroundColor($backgroundColor) |
|
| 175 | + { |
|
| 176 | + $this->backgroundColor = is_null($backgroundColor) ? null : strval($backgroundColor); |
|
| 177 | + |
|
| 178 | + return $this; |
|
| 179 | + } |
|
| 180 | + |
|
| 181 | + /** |
|
| 182 | + * @return int |
|
| 183 | + */ |
|
| 184 | + public function getBorderWidth() |
|
| 185 | + { |
|
| 186 | + return $this->borderWidth; |
|
| 187 | + } |
|
| 188 | + |
|
| 189 | + /** |
|
| 190 | + * @param int $borderWidth |
|
| 191 | + * |
|
| 192 | + * @return Point |
|
| 193 | + */ |
|
| 194 | + public function setBorderWidth($borderWidth) |
|
| 195 | + { |
|
| 196 | + $this->borderWidth = intval($borderWidth); |
|
| 197 | + |
|
| 198 | + return $this; |
|
| 199 | + } |
|
| 200 | + |
|
| 201 | + /** |
|
| 202 | + * @return string |
|
| 203 | + */ |
|
| 204 | + public function getBorderColor() |
|
| 205 | + { |
|
| 206 | + return $this->borderColor; |
|
| 207 | + } |
|
| 208 | + |
|
| 209 | + /** |
|
| 210 | + * @param string $borderColor |
|
| 211 | + * |
|
| 212 | + * @return Point |
|
| 213 | + */ |
|
| 214 | + public function setBorderColor($borderColor) |
|
| 215 | + { |
|
| 216 | + $this->borderColor = is_null($borderColor) ? null : strval($borderColor); |
|
| 217 | + |
|
| 218 | + return $this; |
|
| 219 | + } |
|
| 220 | + |
|
| 221 | + /** |
|
| 222 | + * @return int |
|
| 223 | + */ |
|
| 224 | + public function getHitRadius() |
|
| 225 | + { |
|
| 226 | + return $this->hitRadius; |
|
| 227 | + } |
|
| 228 | + |
|
| 229 | + /** |
|
| 230 | + * @param int $hitRadius |
|
| 231 | + * |
|
| 232 | + * @return Point |
|
| 233 | + */ |
|
| 234 | + public function setHitRadius($hitRadius) |
|
| 235 | + { |
|
| 236 | + $this->hitRadius = intval($hitRadius); |
|
| 237 | + |
|
| 238 | + return $this; |
|
| 239 | + } |
|
| 240 | + |
|
| 241 | + /** |
|
| 242 | + * @return int |
|
| 243 | + */ |
|
| 244 | + public function getHoverRadius() |
|
| 245 | + { |
|
| 246 | + return $this->hoverRadius; |
|
| 247 | + } |
|
| 248 | + |
|
| 249 | + /** |
|
| 250 | + * @param int $hoverRadius |
|
| 251 | + * |
|
| 252 | + * @return Point |
|
| 253 | + */ |
|
| 254 | + public function setHoverRadius($hoverRadius) |
|
| 255 | + { |
|
| 256 | + $this->hoverRadius = intval($hoverRadius); |
|
| 257 | + |
|
| 258 | + return $this; |
|
| 259 | + } |
|
| 260 | + |
|
| 261 | + /** |
|
| 262 | + * @return int |
|
| 263 | + */ |
|
| 264 | + public function getHoverBorderWidth() |
|
| 265 | + { |
|
| 266 | + return $this->hoverBorderWidth; |
|
| 267 | + } |
|
| 268 | + |
|
| 269 | + /** |
|
| 270 | + * @param int $hoverBorderWidth |
|
| 271 | + * |
|
| 272 | + * @return Point |
|
| 273 | + */ |
|
| 274 | + public function setHoverBorderWidth($hoverBorderWidth) |
|
| 275 | + { |
|
| 276 | + $this->hoverBorderWidth = intval($hoverBorderWidth); |
|
| 277 | + |
|
| 278 | + return $this; |
|
| 279 | + } |
|
| 280 | + |
|
| 281 | + /** |
|
| 282 | + * @return array |
|
| 283 | + */ |
|
| 284 | + public function jsonSerialize() |
|
| 285 | + { |
|
| 286 | + return $this->getArrayCopy(); |
|
| 287 | + } |
|
| 288 | 288 | } |
@@ -14,313 +14,313 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Callbacks implements ArraySerializableInterface, JsonSerializable |
| 16 | 16 | { |
| 17 | - use ArraySerializable; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * @var Expr |
|
| 21 | - */ |
|
| 22 | - private $beforeTitle; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @var Expr |
|
| 26 | - */ |
|
| 27 | - private $title; |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * @var Expr |
|
| 31 | - */ |
|
| 32 | - private $afterTitle; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * @var Expr |
|
| 36 | - */ |
|
| 37 | - private $beforeLabel; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @var Expr |
|
| 41 | - */ |
|
| 42 | - private $label; |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * @var Expr |
|
| 46 | - */ |
|
| 47 | - private $labelColor; |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * @var Expr |
|
| 51 | - */ |
|
| 52 | - private $afterLabel; |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * @var Expr |
|
| 56 | - */ |
|
| 57 | - private $afterBody; |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * @var Expr |
|
| 61 | - */ |
|
| 62 | - private $beforeFooter; |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * @var Expr |
|
| 66 | - */ |
|
| 67 | - private $footer; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * @var Expr |
|
| 71 | - */ |
|
| 72 | - private $afterFooter; |
|
| 73 | - |
|
| 74 | - /** |
|
| 75 | - * @var Expr |
|
| 76 | - */ |
|
| 77 | - private $dataPoints; |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @return Expr |
|
| 81 | - */ |
|
| 82 | - public function getBeforeTitle() |
|
| 83 | - { |
|
| 84 | - return $this->beforeTitle; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * @param string $beforeTitle |
|
| 89 | - * |
|
| 90 | - * @return $this |
|
| 91 | - */ |
|
| 92 | - public function setBeforeTitle($beforeTitle) |
|
| 93 | - { |
|
| 94 | - $this->beforeTitle = new Expr(strval($beforeTitle)); |
|
| 95 | - |
|
| 96 | - return $this; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - /** |
|
| 100 | - * @return Expr |
|
| 101 | - */ |
|
| 102 | - public function getTitle() |
|
| 103 | - { |
|
| 104 | - return $this->title; |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * @param string $title |
|
| 109 | - * |
|
| 110 | - * @return $this |
|
| 111 | - */ |
|
| 112 | - public function setTitle($title) |
|
| 113 | - { |
|
| 114 | - $this->title = new Expr(strval($title)); |
|
| 115 | - |
|
| 116 | - return $this; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * @return Expr |
|
| 121 | - */ |
|
| 122 | - public function getAfterTitle() |
|
| 123 | - { |
|
| 124 | - return $this->afterTitle; |
|
| 125 | - } |
|
| 126 | - |
|
| 127 | - /** |
|
| 128 | - * @param string $afterTitle |
|
| 129 | - * |
|
| 130 | - * @return $this |
|
| 131 | - */ |
|
| 132 | - public function setAfterTitle($afterTitle) |
|
| 133 | - { |
|
| 134 | - $this->afterTitle = new Expr(strval($afterTitle)); |
|
| 135 | - |
|
| 136 | - return $this; |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * @return Expr |
|
| 141 | - */ |
|
| 142 | - public function getBeforeLabel() |
|
| 143 | - { |
|
| 144 | - return $this->beforeLabel; |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - /** |
|
| 148 | - * @param string $beforeLabel |
|
| 149 | - * |
|
| 150 | - * @return $this |
|
| 151 | - */ |
|
| 152 | - public function setBeforeLabel($beforeLabel) |
|
| 153 | - { |
|
| 154 | - $this->beforeLabel = new Expr(strval($beforeLabel)); |
|
| 155 | - |
|
| 156 | - return $this; |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * @return Expr |
|
| 161 | - */ |
|
| 162 | - public function getLabel() |
|
| 163 | - { |
|
| 164 | - return $this->label; |
|
| 165 | - } |
|
| 166 | - |
|
| 167 | - /** |
|
| 168 | - * @param string $label |
|
| 169 | - * |
|
| 170 | - * @return $this |
|
| 171 | - */ |
|
| 172 | - public function setLabel($label) |
|
| 173 | - { |
|
| 174 | - $this->label = new Expr(strval($label)); |
|
| 175 | - |
|
| 176 | - return $this; |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - /** |
|
| 180 | - * @return Expr |
|
| 181 | - */ |
|
| 182 | - public function getLabelColor() |
|
| 183 | - { |
|
| 184 | - return $this->labelColor; |
|
| 185 | - } |
|
| 186 | - |
|
| 187 | - /** |
|
| 188 | - * @param string $labelColor |
|
| 189 | - * |
|
| 190 | - * @return $this |
|
| 191 | - */ |
|
| 192 | - public function setLabelColor($labelColor) |
|
| 193 | - { |
|
| 194 | - $this->labelColor = new Expr(strval($labelColor)); |
|
| 195 | - |
|
| 196 | - return $this; |
|
| 197 | - } |
|
| 198 | - |
|
| 199 | - /** |
|
| 200 | - * @return Expr |
|
| 201 | - */ |
|
| 202 | - public function getAfterLabel() |
|
| 203 | - { |
|
| 204 | - return $this->afterLabel; |
|
| 205 | - } |
|
| 206 | - |
|
| 207 | - /** |
|
| 208 | - * @param string $afterLabel |
|
| 209 | - * |
|
| 210 | - * @return $this |
|
| 211 | - */ |
|
| 212 | - public function setAfterLabel($afterLabel) |
|
| 213 | - { |
|
| 214 | - $this->afterLabel = new Expr(strval($afterLabel)); |
|
| 215 | - |
|
| 216 | - return $this; |
|
| 217 | - } |
|
| 218 | - |
|
| 219 | - /** |
|
| 220 | - * @return Expr |
|
| 221 | - */ |
|
| 222 | - public function getAfterBody() |
|
| 223 | - { |
|
| 224 | - return $this->afterBody; |
|
| 225 | - } |
|
| 226 | - |
|
| 227 | - /** |
|
| 228 | - * @param string $afterBody |
|
| 229 | - * |
|
| 230 | - * @return $this |
|
| 231 | - */ |
|
| 232 | - public function setAfterBody($afterBody) |
|
| 233 | - { |
|
| 234 | - $this->afterBody = new Expr(strval($afterBody)); |
|
| 235 | - |
|
| 236 | - return $this; |
|
| 237 | - } |
|
| 238 | - |
|
| 239 | - /** |
|
| 240 | - * @return Expr |
|
| 241 | - */ |
|
| 242 | - public function getBeforeFooter() |
|
| 243 | - { |
|
| 244 | - return $this->beforeFooter; |
|
| 245 | - } |
|
| 246 | - |
|
| 247 | - /** |
|
| 248 | - * @param string $beforeFooter |
|
| 249 | - * |
|
| 250 | - * @return $this |
|
| 251 | - */ |
|
| 252 | - public function setBeforeFooter($beforeFooter) |
|
| 253 | - { |
|
| 254 | - $this->beforeFooter = new Expr(strval($beforeFooter)); |
|
| 255 | - |
|
| 256 | - return $this; |
|
| 257 | - } |
|
| 258 | - |
|
| 259 | - /** |
|
| 260 | - * @return Expr |
|
| 261 | - */ |
|
| 262 | - public function getFooter() |
|
| 263 | - { |
|
| 264 | - return $this->footer; |
|
| 265 | - } |
|
| 266 | - |
|
| 267 | - /** |
|
| 268 | - * @param string $footer |
|
| 269 | - * |
|
| 270 | - * @return $this |
|
| 271 | - */ |
|
| 272 | - public function setFooter($footer) |
|
| 273 | - { |
|
| 274 | - $this->footer = new Expr(strval($footer)); |
|
| 275 | - |
|
| 276 | - return $this; |
|
| 277 | - } |
|
| 278 | - |
|
| 279 | - /** |
|
| 280 | - * @return Expr |
|
| 281 | - */ |
|
| 282 | - public function getAfterFooter() |
|
| 283 | - { |
|
| 284 | - return $this->afterFooter; |
|
| 285 | - } |
|
| 286 | - |
|
| 287 | - /** |
|
| 288 | - * @param string $afterFooter |
|
| 289 | - * |
|
| 290 | - * @return $this |
|
| 291 | - */ |
|
| 292 | - public function setAfterFooter($afterFooter) |
|
| 293 | - { |
|
| 294 | - $this->afterFooter = new Expr(strval($afterFooter)); |
|
| 295 | - |
|
| 296 | - return $this; |
|
| 297 | - } |
|
| 298 | - |
|
| 299 | - /** |
|
| 300 | - * @return Expr |
|
| 301 | - */ |
|
| 302 | - public function getDataPoints() |
|
| 303 | - { |
|
| 304 | - return $this->dataPoints; |
|
| 305 | - } |
|
| 306 | - |
|
| 307 | - /** |
|
| 308 | - * @param string $dataPoints |
|
| 309 | - * |
|
| 310 | - * @return $this |
|
| 311 | - */ |
|
| 312 | - public function setDataPoints($dataPoints) |
|
| 313 | - { |
|
| 314 | - $this->dataPoints = new Expr(strval($dataPoints)); |
|
| 315 | - |
|
| 316 | - return $this; |
|
| 317 | - } |
|
| 318 | - |
|
| 319 | - /** |
|
| 320 | - * @return array |
|
| 321 | - */ |
|
| 322 | - public function jsonSerialize() |
|
| 323 | - { |
|
| 324 | - return $this->getArrayCopy(); |
|
| 325 | - } |
|
| 17 | + use ArraySerializable; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * @var Expr |
|
| 21 | + */ |
|
| 22 | + private $beforeTitle; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @var Expr |
|
| 26 | + */ |
|
| 27 | + private $title; |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @var Expr |
|
| 31 | + */ |
|
| 32 | + private $afterTitle; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * @var Expr |
|
| 36 | + */ |
|
| 37 | + private $beforeLabel; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @var Expr |
|
| 41 | + */ |
|
| 42 | + private $label; |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * @var Expr |
|
| 46 | + */ |
|
| 47 | + private $labelColor; |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * @var Expr |
|
| 51 | + */ |
|
| 52 | + private $afterLabel; |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @var Expr |
|
| 56 | + */ |
|
| 57 | + private $afterBody; |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * @var Expr |
|
| 61 | + */ |
|
| 62 | + private $beforeFooter; |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * @var Expr |
|
| 66 | + */ |
|
| 67 | + private $footer; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * @var Expr |
|
| 71 | + */ |
|
| 72 | + private $afterFooter; |
|
| 73 | + |
|
| 74 | + /** |
|
| 75 | + * @var Expr |
|
| 76 | + */ |
|
| 77 | + private $dataPoints; |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @return Expr |
|
| 81 | + */ |
|
| 82 | + public function getBeforeTitle() |
|
| 83 | + { |
|
| 84 | + return $this->beforeTitle; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @param string $beforeTitle |
|
| 89 | + * |
|
| 90 | + * @return $this |
|
| 91 | + */ |
|
| 92 | + public function setBeforeTitle($beforeTitle) |
|
| 93 | + { |
|
| 94 | + $this->beforeTitle = new Expr(strval($beforeTitle)); |
|
| 95 | + |
|
| 96 | + return $this; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + /** |
|
| 100 | + * @return Expr |
|
| 101 | + */ |
|
| 102 | + public function getTitle() |
|
| 103 | + { |
|
| 104 | + return $this->title; |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * @param string $title |
|
| 109 | + * |
|
| 110 | + * @return $this |
|
| 111 | + */ |
|
| 112 | + public function setTitle($title) |
|
| 113 | + { |
|
| 114 | + $this->title = new Expr(strval($title)); |
|
| 115 | + |
|
| 116 | + return $this; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * @return Expr |
|
| 121 | + */ |
|
| 122 | + public function getAfterTitle() |
|
| 123 | + { |
|
| 124 | + return $this->afterTitle; |
|
| 125 | + } |
|
| 126 | + |
|
| 127 | + /** |
|
| 128 | + * @param string $afterTitle |
|
| 129 | + * |
|
| 130 | + * @return $this |
|
| 131 | + */ |
|
| 132 | + public function setAfterTitle($afterTitle) |
|
| 133 | + { |
|
| 134 | + $this->afterTitle = new Expr(strval($afterTitle)); |
|
| 135 | + |
|
| 136 | + return $this; |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * @return Expr |
|
| 141 | + */ |
|
| 142 | + public function getBeforeLabel() |
|
| 143 | + { |
|
| 144 | + return $this->beforeLabel; |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * @param string $beforeLabel |
|
| 149 | + * |
|
| 150 | + * @return $this |
|
| 151 | + */ |
|
| 152 | + public function setBeforeLabel($beforeLabel) |
|
| 153 | + { |
|
| 154 | + $this->beforeLabel = new Expr(strval($beforeLabel)); |
|
| 155 | + |
|
| 156 | + return $this; |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * @return Expr |
|
| 161 | + */ |
|
| 162 | + public function getLabel() |
|
| 163 | + { |
|
| 164 | + return $this->label; |
|
| 165 | + } |
|
| 166 | + |
|
| 167 | + /** |
|
| 168 | + * @param string $label |
|
| 169 | + * |
|
| 170 | + * @return $this |
|
| 171 | + */ |
|
| 172 | + public function setLabel($label) |
|
| 173 | + { |
|
| 174 | + $this->label = new Expr(strval($label)); |
|
| 175 | + |
|
| 176 | + return $this; |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + /** |
|
| 180 | + * @return Expr |
|
| 181 | + */ |
|
| 182 | + public function getLabelColor() |
|
| 183 | + { |
|
| 184 | + return $this->labelColor; |
|
| 185 | + } |
|
| 186 | + |
|
| 187 | + /** |
|
| 188 | + * @param string $labelColor |
|
| 189 | + * |
|
| 190 | + * @return $this |
|
| 191 | + */ |
|
| 192 | + public function setLabelColor($labelColor) |
|
| 193 | + { |
|
| 194 | + $this->labelColor = new Expr(strval($labelColor)); |
|
| 195 | + |
|
| 196 | + return $this; |
|
| 197 | + } |
|
| 198 | + |
|
| 199 | + /** |
|
| 200 | + * @return Expr |
|
| 201 | + */ |
|
| 202 | + public function getAfterLabel() |
|
| 203 | + { |
|
| 204 | + return $this->afterLabel; |
|
| 205 | + } |
|
| 206 | + |
|
| 207 | + /** |
|
| 208 | + * @param string $afterLabel |
|
| 209 | + * |
|
| 210 | + * @return $this |
|
| 211 | + */ |
|
| 212 | + public function setAfterLabel($afterLabel) |
|
| 213 | + { |
|
| 214 | + $this->afterLabel = new Expr(strval($afterLabel)); |
|
| 215 | + |
|
| 216 | + return $this; |
|
| 217 | + } |
|
| 218 | + |
|
| 219 | + /** |
|
| 220 | + * @return Expr |
|
| 221 | + */ |
|
| 222 | + public function getAfterBody() |
|
| 223 | + { |
|
| 224 | + return $this->afterBody; |
|
| 225 | + } |
|
| 226 | + |
|
| 227 | + /** |
|
| 228 | + * @param string $afterBody |
|
| 229 | + * |
|
| 230 | + * @return $this |
|
| 231 | + */ |
|
| 232 | + public function setAfterBody($afterBody) |
|
| 233 | + { |
|
| 234 | + $this->afterBody = new Expr(strval($afterBody)); |
|
| 235 | + |
|
| 236 | + return $this; |
|
| 237 | + } |
|
| 238 | + |
|
| 239 | + /** |
|
| 240 | + * @return Expr |
|
| 241 | + */ |
|
| 242 | + public function getBeforeFooter() |
|
| 243 | + { |
|
| 244 | + return $this->beforeFooter; |
|
| 245 | + } |
|
| 246 | + |
|
| 247 | + /** |
|
| 248 | + * @param string $beforeFooter |
|
| 249 | + * |
|
| 250 | + * @return $this |
|
| 251 | + */ |
|
| 252 | + public function setBeforeFooter($beforeFooter) |
|
| 253 | + { |
|
| 254 | + $this->beforeFooter = new Expr(strval($beforeFooter)); |
|
| 255 | + |
|
| 256 | + return $this; |
|
| 257 | + } |
|
| 258 | + |
|
| 259 | + /** |
|
| 260 | + * @return Expr |
|
| 261 | + */ |
|
| 262 | + public function getFooter() |
|
| 263 | + { |
|
| 264 | + return $this->footer; |
|
| 265 | + } |
|
| 266 | + |
|
| 267 | + /** |
|
| 268 | + * @param string $footer |
|
| 269 | + * |
|
| 270 | + * @return $this |
|
| 271 | + */ |
|
| 272 | + public function setFooter($footer) |
|
| 273 | + { |
|
| 274 | + $this->footer = new Expr(strval($footer)); |
|
| 275 | + |
|
| 276 | + return $this; |
|
| 277 | + } |
|
| 278 | + |
|
| 279 | + /** |
|
| 280 | + * @return Expr |
|
| 281 | + */ |
|
| 282 | + public function getAfterFooter() |
|
| 283 | + { |
|
| 284 | + return $this->afterFooter; |
|
| 285 | + } |
|
| 286 | + |
|
| 287 | + /** |
|
| 288 | + * @param string $afterFooter |
|
| 289 | + * |
|
| 290 | + * @return $this |
|
| 291 | + */ |
|
| 292 | + public function setAfterFooter($afterFooter) |
|
| 293 | + { |
|
| 294 | + $this->afterFooter = new Expr(strval($afterFooter)); |
|
| 295 | + |
|
| 296 | + return $this; |
|
| 297 | + } |
|
| 298 | + |
|
| 299 | + /** |
|
| 300 | + * @return Expr |
|
| 301 | + */ |
|
| 302 | + public function getDataPoints() |
|
| 303 | + { |
|
| 304 | + return $this->dataPoints; |
|
| 305 | + } |
|
| 306 | + |
|
| 307 | + /** |
|
| 308 | + * @param string $dataPoints |
|
| 309 | + * |
|
| 310 | + * @return $this |
|
| 311 | + */ |
|
| 312 | + public function setDataPoints($dataPoints) |
|
| 313 | + { |
|
| 314 | + $this->dataPoints = new Expr(strval($dataPoints)); |
|
| 315 | + |
|
| 316 | + return $this; |
|
| 317 | + } |
|
| 318 | + |
|
| 319 | + /** |
|
| 320 | + * @return array |
|
| 321 | + */ |
|
| 322 | + public function jsonSerialize() |
|
| 323 | + { |
|
| 324 | + return $this->getArrayCopy(); |
|
| 325 | + } |
|
| 326 | 326 | } |
@@ -14,46 +14,46 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Layout implements ArraySerializableInterface, JsonSerializable |
| 16 | 16 | { |
| 17 | - use ArraySerializable; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * @var int|Padding |
|
| 21 | - */ |
|
| 22 | - private $padding; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @param int $padding |
|
| 26 | - */ |
|
| 27 | - public function setPadding($padding) |
|
| 28 | - { |
|
| 29 | - $this->padding = intval($padding); |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * @return int|Padding |
|
| 34 | - */ |
|
| 35 | - public function getPadding() |
|
| 36 | - { |
|
| 37 | - return $this->padding; |
|
| 38 | - } |
|
| 39 | - |
|
| 40 | - /** |
|
| 41 | - * @return Padding |
|
| 42 | - */ |
|
| 43 | - public function padding() |
|
| 44 | - { |
|
| 45 | - if (is_null($this->padding)) { |
|
| 46 | - $this->padding = new Padding(); |
|
| 47 | - } |
|
| 48 | - |
|
| 49 | - return $this->padding; |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @return array |
|
| 54 | - */ |
|
| 55 | - public function jsonSerialize() |
|
| 56 | - { |
|
| 57 | - return $this->getArrayCopy(); |
|
| 58 | - } |
|
| 17 | + use ArraySerializable; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * @var int|Padding |
|
| 21 | + */ |
|
| 22 | + private $padding; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @param int $padding |
|
| 26 | + */ |
|
| 27 | + public function setPadding($padding) |
|
| 28 | + { |
|
| 29 | + $this->padding = intval($padding); |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @return int|Padding |
|
| 34 | + */ |
|
| 35 | + public function getPadding() |
|
| 36 | + { |
|
| 37 | + return $this->padding; |
|
| 38 | + } |
|
| 39 | + |
|
| 40 | + /** |
|
| 41 | + * @return Padding |
|
| 42 | + */ |
|
| 43 | + public function padding() |
|
| 44 | + { |
|
| 45 | + if (is_null($this->padding)) { |
|
| 46 | + $this->padding = new Padding(); |
|
| 47 | + } |
|
| 48 | + |
|
| 49 | + return $this->padding; |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @return array |
|
| 54 | + */ |
|
| 55 | + public function jsonSerialize() |
|
| 56 | + { |
|
| 57 | + return $this->getArrayCopy(); |
|
| 58 | + } |
|
| 59 | 59 | } |
@@ -16,63 +16,63 @@ |
||
| 16 | 16 | */ |
| 17 | 17 | class Scales implements ArraySerializableInterface, JsonSerializable |
| 18 | 18 | { |
| 19 | - use ArraySerializable; |
|
| 19 | + use ArraySerializable; |
|
| 20 | 20 | |
| 21 | - /** |
|
| 22 | - * @var XAxisCollection |
|
| 23 | - */ |
|
| 24 | - private $xAxes; |
|
| 21 | + /** |
|
| 22 | + * @var XAxisCollection |
|
| 23 | + */ |
|
| 24 | + private $xAxes; |
|
| 25 | 25 | |
| 26 | - /** |
|
| 27 | - * @var YAxisCollection |
|
| 28 | - */ |
|
| 29 | - private $yAxes; |
|
| 26 | + /** |
|
| 27 | + * @var YAxisCollection |
|
| 28 | + */ |
|
| 29 | + private $yAxes; |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @return XAxis |
|
| 33 | - */ |
|
| 34 | - public function createXAxis() |
|
| 35 | - { |
|
| 36 | - return new XAxis(); |
|
| 37 | - } |
|
| 31 | + /** |
|
| 32 | + * @return XAxis |
|
| 33 | + */ |
|
| 34 | + public function createXAxis() |
|
| 35 | + { |
|
| 36 | + return new XAxis(); |
|
| 37 | + } |
|
| 38 | 38 | |
| 39 | - /** |
|
| 40 | - * @return YAxis |
|
| 41 | - */ |
|
| 42 | - public function createYAxis() |
|
| 43 | - { |
|
| 44 | - return new YAxis(); |
|
| 45 | - } |
|
| 39 | + /** |
|
| 40 | + * @return YAxis |
|
| 41 | + */ |
|
| 42 | + public function createYAxis() |
|
| 43 | + { |
|
| 44 | + return new YAxis(); |
|
| 45 | + } |
|
| 46 | 46 | |
| 47 | - /** |
|
| 48 | - * @return XAxisCollection |
|
| 49 | - */ |
|
| 50 | - public function getXAxes() |
|
| 51 | - { |
|
| 52 | - if (is_null($this->xAxes)) { |
|
| 53 | - $this->xAxes = new XAxisCollection(); |
|
| 54 | - } |
|
| 47 | + /** |
|
| 48 | + * @return XAxisCollection |
|
| 49 | + */ |
|
| 50 | + public function getXAxes() |
|
| 51 | + { |
|
| 52 | + if (is_null($this->xAxes)) { |
|
| 53 | + $this->xAxes = new XAxisCollection(); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - return $this->xAxes; |
|
| 57 | - } |
|
| 56 | + return $this->xAxes; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - /** |
|
| 60 | - * @return YAxisCollection |
|
| 61 | - */ |
|
| 62 | - public function getYAxes() |
|
| 63 | - { |
|
| 64 | - if (is_null($this->yAxes)) { |
|
| 65 | - $this->yAxes = new YAxisCollection(); |
|
| 66 | - } |
|
| 59 | + /** |
|
| 60 | + * @return YAxisCollection |
|
| 61 | + */ |
|
| 62 | + public function getYAxes() |
|
| 63 | + { |
|
| 64 | + if (is_null($this->yAxes)) { |
|
| 65 | + $this->yAxes = new YAxisCollection(); |
|
| 66 | + } |
|
| 67 | 67 | |
| 68 | - return $this->yAxes; |
|
| 69 | - } |
|
| 68 | + return $this->yAxes; |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | - /** |
|
| 72 | - * @return array |
|
| 73 | - */ |
|
| 74 | - public function jsonSerialize() |
|
| 75 | - { |
|
| 76 | - return $this->getArrayCopy(); |
|
| 77 | - } |
|
| 71 | + /** |
|
| 72 | + * @return array |
|
| 73 | + */ |
|
| 74 | + public function jsonSerialize() |
|
| 75 | + { |
|
| 76 | + return $this->getArrayCopy(); |
|
| 77 | + } |
|
| 78 | 78 | } |
@@ -14,113 +14,113 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Animation implements ArraySerializableInterface, JsonSerializable |
| 16 | 16 | { |
| 17 | - use ArraySerializable; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * @var int |
|
| 21 | - */ |
|
| 22 | - private $duration; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @var string |
|
| 26 | - */ |
|
| 27 | - private $easing; |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * @var Expr |
|
| 31 | - */ |
|
| 32 | - private $onProgress; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * @var Expr |
|
| 36 | - */ |
|
| 37 | - private $onComplete; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @return int |
|
| 41 | - */ |
|
| 42 | - public function getDuration() |
|
| 43 | - { |
|
| 44 | - return $this->duration; |
|
| 45 | - } |
|
| 46 | - |
|
| 47 | - /** |
|
| 48 | - * @param int $duration |
|
| 49 | - * |
|
| 50 | - * @return $this |
|
| 51 | - */ |
|
| 52 | - public function setDuration($duration) |
|
| 53 | - { |
|
| 54 | - $this->duration = $duration; |
|
| 55 | - |
|
| 56 | - return $this; |
|
| 57 | - } |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * @return string |
|
| 61 | - */ |
|
| 62 | - public function getEasing() |
|
| 63 | - { |
|
| 64 | - return $this->easing; |
|
| 65 | - } |
|
| 66 | - |
|
| 67 | - /** |
|
| 68 | - * @param string $easing |
|
| 69 | - * |
|
| 70 | - * @return $this |
|
| 71 | - */ |
|
| 72 | - public function setEasing($easing) |
|
| 73 | - { |
|
| 74 | - $this->easing = $easing; |
|
| 75 | - |
|
| 76 | - return $this; |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @return Expr |
|
| 81 | - */ |
|
| 82 | - public function getOnProgress() |
|
| 83 | - { |
|
| 84 | - return $this->onProgress; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * @param string $onProgress |
|
| 89 | - * |
|
| 90 | - * @return $this |
|
| 91 | - */ |
|
| 92 | - public function setOnProgress($onProgress) |
|
| 93 | - { |
|
| 94 | - $this->onProgress = new Expr(strval($onProgress)); |
|
| 95 | - |
|
| 96 | - return $this; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - /** |
|
| 100 | - * @return Expr |
|
| 101 | - */ |
|
| 102 | - public function getOnComplete() |
|
| 103 | - { |
|
| 104 | - return $this->onComplete; |
|
| 105 | - } |
|
| 106 | - |
|
| 107 | - /** |
|
| 108 | - * @param string $onComplete |
|
| 109 | - * |
|
| 110 | - * @return $this |
|
| 111 | - */ |
|
| 112 | - public function setOnComplete($onComplete) |
|
| 113 | - { |
|
| 114 | - $this->onComplete = new Expr(strval($onComplete)); |
|
| 115 | - |
|
| 116 | - return $this; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * @return array |
|
| 121 | - */ |
|
| 122 | - public function jsonSerialize() |
|
| 123 | - { |
|
| 124 | - return $this->getArrayCopy(); |
|
| 125 | - } |
|
| 17 | + use ArraySerializable; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * @var int |
|
| 21 | + */ |
|
| 22 | + private $duration; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @var string |
|
| 26 | + */ |
|
| 27 | + private $easing; |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @var Expr |
|
| 31 | + */ |
|
| 32 | + private $onProgress; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * @var Expr |
|
| 36 | + */ |
|
| 37 | + private $onComplete; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @return int |
|
| 41 | + */ |
|
| 42 | + public function getDuration() |
|
| 43 | + { |
|
| 44 | + return $this->duration; |
|
| 45 | + } |
|
| 46 | + |
|
| 47 | + /** |
|
| 48 | + * @param int $duration |
|
| 49 | + * |
|
| 50 | + * @return $this |
|
| 51 | + */ |
|
| 52 | + public function setDuration($duration) |
|
| 53 | + { |
|
| 54 | + $this->duration = $duration; |
|
| 55 | + |
|
| 56 | + return $this; |
|
| 57 | + } |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * @return string |
|
| 61 | + */ |
|
| 62 | + public function getEasing() |
|
| 63 | + { |
|
| 64 | + return $this->easing; |
|
| 65 | + } |
|
| 66 | + |
|
| 67 | + /** |
|
| 68 | + * @param string $easing |
|
| 69 | + * |
|
| 70 | + * @return $this |
|
| 71 | + */ |
|
| 72 | + public function setEasing($easing) |
|
| 73 | + { |
|
| 74 | + $this->easing = $easing; |
|
| 75 | + |
|
| 76 | + return $this; |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @return Expr |
|
| 81 | + */ |
|
| 82 | + public function getOnProgress() |
|
| 83 | + { |
|
| 84 | + return $this->onProgress; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @param string $onProgress |
|
| 89 | + * |
|
| 90 | + * @return $this |
|
| 91 | + */ |
|
| 92 | + public function setOnProgress($onProgress) |
|
| 93 | + { |
|
| 94 | + $this->onProgress = new Expr(strval($onProgress)); |
|
| 95 | + |
|
| 96 | + return $this; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + /** |
|
| 100 | + * @return Expr |
|
| 101 | + */ |
|
| 102 | + public function getOnComplete() |
|
| 103 | + { |
|
| 104 | + return $this->onComplete; |
|
| 105 | + } |
|
| 106 | + |
|
| 107 | + /** |
|
| 108 | + * @param string $onComplete |
|
| 109 | + * |
|
| 110 | + * @return $this |
|
| 111 | + */ |
|
| 112 | + public function setOnComplete($onComplete) |
|
| 113 | + { |
|
| 114 | + $this->onComplete = new Expr(strval($onComplete)); |
|
| 115 | + |
|
| 116 | + return $this; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * @return array |
|
| 121 | + */ |
|
| 122 | + public function jsonSerialize() |
|
| 123 | + { |
|
| 124 | + return $this->getArrayCopy(); |
|
| 125 | + } |
|
| 126 | 126 | } |
@@ -9,36 +9,36 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | class Json extends Renderer |
| 11 | 11 | { |
| 12 | - /** |
|
| 13 | - * Render the necessary JSON for the chart to function in the frontend. |
|
| 14 | - * |
|
| 15 | - * @param int|null $flags |
|
| 16 | - * |
|
| 17 | - * @return string |
|
| 18 | - * @throws \ReflectionException |
|
| 19 | - */ |
|
| 20 | - public function render($flags = JSON_PRETTY_PRINT) |
|
| 21 | - { |
|
| 22 | - $config = [ |
|
| 23 | - 'type' => constant(get_class($this->chart) . "::TYPE"), |
|
| 24 | - 'data' => [], |
|
| 25 | - ]; |
|
| 12 | + /** |
|
| 13 | + * Render the necessary JSON for the chart to function in the frontend. |
|
| 14 | + * |
|
| 15 | + * @param int|null $flags |
|
| 16 | + * |
|
| 17 | + * @return string |
|
| 18 | + * @throws \ReflectionException |
|
| 19 | + */ |
|
| 20 | + public function render($flags = JSON_PRETTY_PRINT) |
|
| 21 | + { |
|
| 22 | + $config = [ |
|
| 23 | + 'type' => constant(get_class($this->chart) . "::TYPE"), |
|
| 24 | + 'data' => [], |
|
| 25 | + ]; |
|
| 26 | 26 | |
| 27 | - $labels = $this->chart->labels()->getArrayCopy(); |
|
| 28 | - if ($labels) { |
|
| 29 | - $config['data']['labels'] = $labels; |
|
| 30 | - } |
|
| 27 | + $labels = $this->chart->labels()->getArrayCopy(); |
|
| 28 | + if ($labels) { |
|
| 29 | + $config['data']['labels'] = $labels; |
|
| 30 | + } |
|
| 31 | 31 | |
| 32 | - $dataSets = $this->chart->dataSets()->getArrayCopy(); |
|
| 33 | - if ($dataSets) { |
|
| 34 | - $config['data']['datasets'] = $dataSets; |
|
| 35 | - } |
|
| 32 | + $dataSets = $this->chart->dataSets()->getArrayCopy(); |
|
| 33 | + if ($dataSets) { |
|
| 34 | + $config['data']['datasets'] = $dataSets; |
|
| 35 | + } |
|
| 36 | 36 | |
| 37 | - $options = $this->chart->options()->getArrayCopy(); |
|
| 38 | - if ($options) { |
|
| 39 | - $config['options'] = $options; |
|
| 40 | - } |
|
| 37 | + $options = $this->chart->options()->getArrayCopy(); |
|
| 38 | + if ($options) { |
|
| 39 | + $config['options'] = $options; |
|
| 40 | + } |
|
| 41 | 41 | |
| 42 | - return json_encode($config, $flags); |
|
| 43 | - } |
|
| 42 | + return json_encode($config, $flags); |
|
| 43 | + } |
|
| 44 | 44 | } |
@@ -10,23 +10,23 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | abstract class Renderer implements RendererInterface |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Flag used for rendering JSON in pretty mode. |
|
| 15 | - */ |
|
| 16 | - const RENDER_PRETTY = JSON_PRETTY_PRINT; |
|
| 13 | + /** |
|
| 14 | + * Flag used for rendering JSON in pretty mode. |
|
| 15 | + */ |
|
| 16 | + const RENDER_PRETTY = JSON_PRETTY_PRINT; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @var Chart The chart that needs to be rendered. |
|
| 20 | - */ |
|
| 21 | - protected $chart; |
|
| 18 | + /** |
|
| 19 | + * @var Chart The chart that needs to be rendered. |
|
| 20 | + */ |
|
| 21 | + protected $chart; |
|
| 22 | 22 | |
| 23 | - /** |
|
| 24 | - * RendererInterface constructor. Expects an instance of a chart. |
|
| 25 | - * |
|
| 26 | - * @param Chart $chart The Chart that needs to be rendered. |
|
| 27 | - */ |
|
| 28 | - public function __construct(Chart $chart) |
|
| 29 | - { |
|
| 30 | - $this->chart = $chart; |
|
| 31 | - } |
|
| 23 | + /** |
|
| 24 | + * RendererInterface constructor. Expects an instance of a chart. |
|
| 25 | + * |
|
| 26 | + * @param Chart $chart The Chart that needs to be rendered. |
|
| 27 | + */ |
|
| 28 | + public function __construct(Chart $chart) |
|
| 29 | + { |
|
| 30 | + $this->chart = $chart; |
|
| 31 | + } |
|
| 32 | 32 | } |