@@ -13,348 +13,348 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class DataSet implements ChartOwnedInterface, ArraySerializableInterface, \JsonSerializable |
| 15 | 15 | { |
| 16 | - use ChartOwned; |
|
| 17 | - use ArraySerializable; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * @var string |
|
| 21 | - */ |
|
| 22 | - protected $type; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @var Data |
|
| 26 | - */ |
|
| 27 | - protected $data; |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * @var string |
|
| 31 | - */ |
|
| 32 | - protected $label; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * @var string |
|
| 36 | - */ |
|
| 37 | - protected $xAxisID; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @var string |
|
| 41 | - */ |
|
| 42 | - protected $yAxisID; |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * @var string|string[] |
|
| 46 | - */ |
|
| 47 | - protected $backgroundColor; |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * @var string|string[] |
|
| 51 | - */ |
|
| 52 | - protected $borderColor; |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * @var int|int[] |
|
| 56 | - */ |
|
| 57 | - protected $borderWidth; |
|
| 58 | - |
|
| 59 | - /** |
|
| 60 | - * @var string |
|
| 61 | - */ |
|
| 62 | - protected $borderSkipped; |
|
| 63 | - |
|
| 64 | - /** |
|
| 65 | - * @var string|string[] |
|
| 66 | - */ |
|
| 67 | - protected $hoverBackgroundColor; |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * @var string|string[] |
|
| 71 | - */ |
|
| 72 | - protected $hoverBorderColor; |
|
| 73 | - |
|
| 74 | - /** |
|
| 75 | - * @var int|int[] |
|
| 76 | - */ |
|
| 77 | - protected $hoverBorderWidth; |
|
| 78 | - |
|
| 79 | - /** |
|
| 80 | - * @return string |
|
| 81 | - */ |
|
| 82 | - public function getType() |
|
| 83 | - { |
|
| 84 | - return $this->type; |
|
| 85 | - } |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * @param string $type |
|
| 89 | - * |
|
| 90 | - * @return $this |
|
| 91 | - */ |
|
| 92 | - public function setType($type) |
|
| 93 | - { |
|
| 94 | - $this->type = $type; |
|
| 95 | - |
|
| 96 | - return $this; |
|
| 97 | - } |
|
| 98 | - |
|
| 99 | - /** |
|
| 100 | - * @return Data |
|
| 101 | - */ |
|
| 102 | - public function data() |
|
| 103 | - { |
|
| 104 | - if (is_null($this->data)) { |
|
| 105 | - $this->data = new Data(); |
|
| 106 | - } |
|
| 107 | - |
|
| 108 | - return $this->data; |
|
| 109 | - } |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * @return string |
|
| 113 | - */ |
|
| 114 | - public function getLabel() |
|
| 115 | - { |
|
| 116 | - return $this->label; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - /** |
|
| 120 | - * @param string $label |
|
| 121 | - * |
|
| 122 | - * @return $this |
|
| 123 | - */ |
|
| 124 | - public function setLabel($label) |
|
| 125 | - { |
|
| 126 | - $this->label = strval($label); |
|
| 127 | - |
|
| 128 | - return $this; |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - /** |
|
| 132 | - * @return string |
|
| 133 | - */ |
|
| 134 | - public function getXAxisID() |
|
| 135 | - { |
|
| 136 | - return $this->xAxisID; |
|
| 137 | - } |
|
| 138 | - |
|
| 139 | - /** |
|
| 140 | - * @param string $xAxisID |
|
| 141 | - * |
|
| 142 | - * @return $this |
|
| 143 | - */ |
|
| 144 | - public function setXAxisID($xAxisID) |
|
| 145 | - { |
|
| 146 | - $this->xAxisID = strval($xAxisID); |
|
| 147 | - |
|
| 148 | - return $this; |
|
| 149 | - } |
|
| 150 | - |
|
| 151 | - /** |
|
| 152 | - * @return string |
|
| 153 | - */ |
|
| 154 | - public function getYAxisID() |
|
| 155 | - { |
|
| 156 | - return $this->yAxisID; |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - /** |
|
| 160 | - * @param string $yAxisID |
|
| 161 | - * |
|
| 162 | - * @return $this |
|
| 163 | - */ |
|
| 164 | - public function setYAxisID($yAxisID) |
|
| 165 | - { |
|
| 166 | - $this->yAxisID = strval($yAxisID); |
|
| 167 | - |
|
| 168 | - return $this; |
|
| 169 | - } |
|
| 170 | - |
|
| 171 | - /** |
|
| 172 | - * @return string|string[] |
|
| 173 | - */ |
|
| 174 | - public function getBackgroundColor() |
|
| 175 | - { |
|
| 176 | - return $this->backgroundColor; |
|
| 177 | - } |
|
| 178 | - |
|
| 179 | - /** |
|
| 180 | - * @param string|string[] $backgroundColor |
|
| 181 | - * |
|
| 182 | - * @return $this |
|
| 183 | - */ |
|
| 184 | - public function setBackgroundColor($backgroundColor) |
|
| 185 | - { |
|
| 186 | - if (is_array($backgroundColor)) { |
|
| 187 | - $backgroundColor = array_map('strval', $backgroundColor); |
|
| 188 | - } |
|
| 189 | - if (! is_array($backgroundColor)) { |
|
| 190 | - $backgroundColor = strval($backgroundColor); |
|
| 191 | - } |
|
| 192 | - |
|
| 193 | - $this->backgroundColor = $backgroundColor; |
|
| 194 | - |
|
| 195 | - return $this; |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * @return string|string[] |
|
| 200 | - */ |
|
| 201 | - public function getBorderColor() |
|
| 202 | - { |
|
| 203 | - return $this->borderColor; |
|
| 204 | - } |
|
| 205 | - |
|
| 206 | - /** |
|
| 207 | - * @param string|string[] $borderColor |
|
| 208 | - * |
|
| 209 | - * @return $this |
|
| 210 | - */ |
|
| 211 | - public function setBorderColor($borderColor) |
|
| 212 | - { |
|
| 213 | - if (is_array($borderColor)) { |
|
| 214 | - $borderColor = array_map('strval', $borderColor); |
|
| 215 | - } |
|
| 216 | - if (! is_array($borderColor)) { |
|
| 217 | - $borderColor = strval($borderColor); |
|
| 218 | - } |
|
| 219 | - |
|
| 220 | - $this->borderColor = $borderColor; |
|
| 221 | - |
|
| 222 | - return $this; |
|
| 223 | - } |
|
| 224 | - |
|
| 225 | - /** |
|
| 226 | - * @return int|int[] |
|
| 227 | - */ |
|
| 228 | - public function getBorderWidth() |
|
| 229 | - { |
|
| 230 | - return $this->borderWidth; |
|
| 231 | - } |
|
| 232 | - |
|
| 233 | - /** |
|
| 234 | - * @param int|int[] $borderWidth |
|
| 235 | - * |
|
| 236 | - * @return $this |
|
| 237 | - */ |
|
| 238 | - public function setBorderWidth($borderWidth) |
|
| 239 | - { |
|
| 240 | - if (is_array($borderWidth)) { |
|
| 241 | - $borderWidth = array_map('intval', $borderWidth); |
|
| 242 | - } |
|
| 243 | - if (! is_array($borderWidth)) { |
|
| 244 | - $borderWidth = intval($borderWidth); |
|
| 245 | - } |
|
| 246 | - |
|
| 247 | - $this->borderWidth = $borderWidth; |
|
| 248 | - |
|
| 249 | - return $this; |
|
| 250 | - } |
|
| 251 | - |
|
| 252 | - /** |
|
| 253 | - * @return string |
|
| 254 | - */ |
|
| 255 | - public function getBorderSkipped() |
|
| 256 | - { |
|
| 257 | - return $this->borderSkipped; |
|
| 258 | - } |
|
| 259 | - |
|
| 260 | - /** |
|
| 261 | - * @param string $borderSkipped |
|
| 262 | - * |
|
| 263 | - * @return $this |
|
| 264 | - */ |
|
| 265 | - public function setBorderSkipped($borderSkipped) |
|
| 266 | - { |
|
| 267 | - $this->borderSkipped = strval($borderSkipped); |
|
| 268 | - |
|
| 269 | - return $this; |
|
| 270 | - } |
|
| 271 | - |
|
| 272 | - /** |
|
| 273 | - * @return string|string[] |
|
| 274 | - */ |
|
| 275 | - public function getHoverBackgroundColor() |
|
| 276 | - { |
|
| 277 | - return $this->hoverBackgroundColor; |
|
| 278 | - } |
|
| 279 | - |
|
| 280 | - /** |
|
| 281 | - * @param string|string[] $hoverBackgroundColor |
|
| 282 | - * |
|
| 283 | - * @return $this |
|
| 284 | - */ |
|
| 285 | - public function setHoverBackgroundColor($hoverBackgroundColor) |
|
| 286 | - { |
|
| 287 | - if (is_array($hoverBackgroundColor)) { |
|
| 288 | - $hoverBackgroundColor = array_map('strval', $hoverBackgroundColor); |
|
| 289 | - } |
|
| 290 | - if (! is_array($hoverBackgroundColor)) { |
|
| 291 | - $hoverBackgroundColor = strval($hoverBackgroundColor); |
|
| 292 | - } |
|
| 293 | - |
|
| 294 | - $this->hoverBackgroundColor = $hoverBackgroundColor; |
|
| 295 | - |
|
| 296 | - return $this; |
|
| 297 | - } |
|
| 298 | - |
|
| 299 | - /** |
|
| 300 | - * @return string|string[] |
|
| 301 | - */ |
|
| 302 | - public function getHoverBorderColor() |
|
| 303 | - { |
|
| 304 | - return $this->hoverBorderColor; |
|
| 305 | - } |
|
| 306 | - |
|
| 307 | - /** |
|
| 308 | - * @param string|string[] $hoverBorderColor |
|
| 309 | - * |
|
| 310 | - * @return $this |
|
| 311 | - */ |
|
| 312 | - public function setHoverBorderColor($hoverBorderColor) |
|
| 313 | - { |
|
| 314 | - if (is_array($hoverBorderColor)) { |
|
| 315 | - $hoverBorderColor = array_map('strval', $hoverBorderColor); |
|
| 316 | - } |
|
| 317 | - if (! is_array($hoverBorderColor)) { |
|
| 318 | - $hoverBorderColor = strval($hoverBorderColor); |
|
| 319 | - } |
|
| 320 | - |
|
| 321 | - $this->hoverBorderColor = $hoverBorderColor; |
|
| 322 | - |
|
| 323 | - return $this; |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - /** |
|
| 327 | - * @return int|int[] |
|
| 328 | - */ |
|
| 329 | - public function getHoverBorderWidth() |
|
| 330 | - { |
|
| 331 | - return $this->hoverBorderWidth; |
|
| 332 | - } |
|
| 333 | - |
|
| 334 | - /** |
|
| 335 | - * @param int|int[] $hoverBorderWidth |
|
| 336 | - * |
|
| 337 | - * @return $this |
|
| 338 | - */ |
|
| 339 | - public function setHoverBorderWidth($hoverBorderWidth) |
|
| 340 | - { |
|
| 341 | - if (is_array($hoverBorderWidth)) { |
|
| 342 | - $hoverBorderWidth = array_map('intval', $hoverBorderWidth); |
|
| 343 | - } |
|
| 344 | - if (! is_array($hoverBorderWidth)) { |
|
| 345 | - $hoverBorderWidth = intval($hoverBorderWidth); |
|
| 346 | - } |
|
| 347 | - |
|
| 348 | - $this->hoverBorderWidth = $hoverBorderWidth; |
|
| 349 | - |
|
| 350 | - return $this; |
|
| 351 | - } |
|
| 352 | - |
|
| 353 | - /** |
|
| 354 | - * |
|
| 355 | - */ |
|
| 356 | - public function jsonSerialize() |
|
| 357 | - { |
|
| 358 | - return Json::encode($this->getArrayCopy()); |
|
| 359 | - } |
|
| 16 | + use ChartOwned; |
|
| 17 | + use ArraySerializable; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * @var string |
|
| 21 | + */ |
|
| 22 | + protected $type; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @var Data |
|
| 26 | + */ |
|
| 27 | + protected $data; |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @var string |
|
| 31 | + */ |
|
| 32 | + protected $label; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * @var string |
|
| 36 | + */ |
|
| 37 | + protected $xAxisID; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @var string |
|
| 41 | + */ |
|
| 42 | + protected $yAxisID; |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * @var string|string[] |
|
| 46 | + */ |
|
| 47 | + protected $backgroundColor; |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * @var string|string[] |
|
| 51 | + */ |
|
| 52 | + protected $borderColor; |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @var int|int[] |
|
| 56 | + */ |
|
| 57 | + protected $borderWidth; |
|
| 58 | + |
|
| 59 | + /** |
|
| 60 | + * @var string |
|
| 61 | + */ |
|
| 62 | + protected $borderSkipped; |
|
| 63 | + |
|
| 64 | + /** |
|
| 65 | + * @var string|string[] |
|
| 66 | + */ |
|
| 67 | + protected $hoverBackgroundColor; |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * @var string|string[] |
|
| 71 | + */ |
|
| 72 | + protected $hoverBorderColor; |
|
| 73 | + |
|
| 74 | + /** |
|
| 75 | + * @var int|int[] |
|
| 76 | + */ |
|
| 77 | + protected $hoverBorderWidth; |
|
| 78 | + |
|
| 79 | + /** |
|
| 80 | + * @return string |
|
| 81 | + */ |
|
| 82 | + public function getType() |
|
| 83 | + { |
|
| 84 | + return $this->type; |
|
| 85 | + } |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @param string $type |
|
| 89 | + * |
|
| 90 | + * @return $this |
|
| 91 | + */ |
|
| 92 | + public function setType($type) |
|
| 93 | + { |
|
| 94 | + $this->type = $type; |
|
| 95 | + |
|
| 96 | + return $this; |
|
| 97 | + } |
|
| 98 | + |
|
| 99 | + /** |
|
| 100 | + * @return Data |
|
| 101 | + */ |
|
| 102 | + public function data() |
|
| 103 | + { |
|
| 104 | + if (is_null($this->data)) { |
|
| 105 | + $this->data = new Data(); |
|
| 106 | + } |
|
| 107 | + |
|
| 108 | + return $this->data; |
|
| 109 | + } |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * @return string |
|
| 113 | + */ |
|
| 114 | + public function getLabel() |
|
| 115 | + { |
|
| 116 | + return $this->label; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + /** |
|
| 120 | + * @param string $label |
|
| 121 | + * |
|
| 122 | + * @return $this |
|
| 123 | + */ |
|
| 124 | + public function setLabel($label) |
|
| 125 | + { |
|
| 126 | + $this->label = strval($label); |
|
| 127 | + |
|
| 128 | + return $this; |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + /** |
|
| 132 | + * @return string |
|
| 133 | + */ |
|
| 134 | + public function getXAxisID() |
|
| 135 | + { |
|
| 136 | + return $this->xAxisID; |
|
| 137 | + } |
|
| 138 | + |
|
| 139 | + /** |
|
| 140 | + * @param string $xAxisID |
|
| 141 | + * |
|
| 142 | + * @return $this |
|
| 143 | + */ |
|
| 144 | + public function setXAxisID($xAxisID) |
|
| 145 | + { |
|
| 146 | + $this->xAxisID = strval($xAxisID); |
|
| 147 | + |
|
| 148 | + return $this; |
|
| 149 | + } |
|
| 150 | + |
|
| 151 | + /** |
|
| 152 | + * @return string |
|
| 153 | + */ |
|
| 154 | + public function getYAxisID() |
|
| 155 | + { |
|
| 156 | + return $this->yAxisID; |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + /** |
|
| 160 | + * @param string $yAxisID |
|
| 161 | + * |
|
| 162 | + * @return $this |
|
| 163 | + */ |
|
| 164 | + public function setYAxisID($yAxisID) |
|
| 165 | + { |
|
| 166 | + $this->yAxisID = strval($yAxisID); |
|
| 167 | + |
|
| 168 | + return $this; |
|
| 169 | + } |
|
| 170 | + |
|
| 171 | + /** |
|
| 172 | + * @return string|string[] |
|
| 173 | + */ |
|
| 174 | + public function getBackgroundColor() |
|
| 175 | + { |
|
| 176 | + return $this->backgroundColor; |
|
| 177 | + } |
|
| 178 | + |
|
| 179 | + /** |
|
| 180 | + * @param string|string[] $backgroundColor |
|
| 181 | + * |
|
| 182 | + * @return $this |
|
| 183 | + */ |
|
| 184 | + public function setBackgroundColor($backgroundColor) |
|
| 185 | + { |
|
| 186 | + if (is_array($backgroundColor)) { |
|
| 187 | + $backgroundColor = array_map('strval', $backgroundColor); |
|
| 188 | + } |
|
| 189 | + if (! is_array($backgroundColor)) { |
|
| 190 | + $backgroundColor = strval($backgroundColor); |
|
| 191 | + } |
|
| 192 | + |
|
| 193 | + $this->backgroundColor = $backgroundColor; |
|
| 194 | + |
|
| 195 | + return $this; |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * @return string|string[] |
|
| 200 | + */ |
|
| 201 | + public function getBorderColor() |
|
| 202 | + { |
|
| 203 | + return $this->borderColor; |
|
| 204 | + } |
|
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * @param string|string[] $borderColor |
|
| 208 | + * |
|
| 209 | + * @return $this |
|
| 210 | + */ |
|
| 211 | + public function setBorderColor($borderColor) |
|
| 212 | + { |
|
| 213 | + if (is_array($borderColor)) { |
|
| 214 | + $borderColor = array_map('strval', $borderColor); |
|
| 215 | + } |
|
| 216 | + if (! is_array($borderColor)) { |
|
| 217 | + $borderColor = strval($borderColor); |
|
| 218 | + } |
|
| 219 | + |
|
| 220 | + $this->borderColor = $borderColor; |
|
| 221 | + |
|
| 222 | + return $this; |
|
| 223 | + } |
|
| 224 | + |
|
| 225 | + /** |
|
| 226 | + * @return int|int[] |
|
| 227 | + */ |
|
| 228 | + public function getBorderWidth() |
|
| 229 | + { |
|
| 230 | + return $this->borderWidth; |
|
| 231 | + } |
|
| 232 | + |
|
| 233 | + /** |
|
| 234 | + * @param int|int[] $borderWidth |
|
| 235 | + * |
|
| 236 | + * @return $this |
|
| 237 | + */ |
|
| 238 | + public function setBorderWidth($borderWidth) |
|
| 239 | + { |
|
| 240 | + if (is_array($borderWidth)) { |
|
| 241 | + $borderWidth = array_map('intval', $borderWidth); |
|
| 242 | + } |
|
| 243 | + if (! is_array($borderWidth)) { |
|
| 244 | + $borderWidth = intval($borderWidth); |
|
| 245 | + } |
|
| 246 | + |
|
| 247 | + $this->borderWidth = $borderWidth; |
|
| 248 | + |
|
| 249 | + return $this; |
|
| 250 | + } |
|
| 251 | + |
|
| 252 | + /** |
|
| 253 | + * @return string |
|
| 254 | + */ |
|
| 255 | + public function getBorderSkipped() |
|
| 256 | + { |
|
| 257 | + return $this->borderSkipped; |
|
| 258 | + } |
|
| 259 | + |
|
| 260 | + /** |
|
| 261 | + * @param string $borderSkipped |
|
| 262 | + * |
|
| 263 | + * @return $this |
|
| 264 | + */ |
|
| 265 | + public function setBorderSkipped($borderSkipped) |
|
| 266 | + { |
|
| 267 | + $this->borderSkipped = strval($borderSkipped); |
|
| 268 | + |
|
| 269 | + return $this; |
|
| 270 | + } |
|
| 271 | + |
|
| 272 | + /** |
|
| 273 | + * @return string|string[] |
|
| 274 | + */ |
|
| 275 | + public function getHoverBackgroundColor() |
|
| 276 | + { |
|
| 277 | + return $this->hoverBackgroundColor; |
|
| 278 | + } |
|
| 279 | + |
|
| 280 | + /** |
|
| 281 | + * @param string|string[] $hoverBackgroundColor |
|
| 282 | + * |
|
| 283 | + * @return $this |
|
| 284 | + */ |
|
| 285 | + public function setHoverBackgroundColor($hoverBackgroundColor) |
|
| 286 | + { |
|
| 287 | + if (is_array($hoverBackgroundColor)) { |
|
| 288 | + $hoverBackgroundColor = array_map('strval', $hoverBackgroundColor); |
|
| 289 | + } |
|
| 290 | + if (! is_array($hoverBackgroundColor)) { |
|
| 291 | + $hoverBackgroundColor = strval($hoverBackgroundColor); |
|
| 292 | + } |
|
| 293 | + |
|
| 294 | + $this->hoverBackgroundColor = $hoverBackgroundColor; |
|
| 295 | + |
|
| 296 | + return $this; |
|
| 297 | + } |
|
| 298 | + |
|
| 299 | + /** |
|
| 300 | + * @return string|string[] |
|
| 301 | + */ |
|
| 302 | + public function getHoverBorderColor() |
|
| 303 | + { |
|
| 304 | + return $this->hoverBorderColor; |
|
| 305 | + } |
|
| 306 | + |
|
| 307 | + /** |
|
| 308 | + * @param string|string[] $hoverBorderColor |
|
| 309 | + * |
|
| 310 | + * @return $this |
|
| 311 | + */ |
|
| 312 | + public function setHoverBorderColor($hoverBorderColor) |
|
| 313 | + { |
|
| 314 | + if (is_array($hoverBorderColor)) { |
|
| 315 | + $hoverBorderColor = array_map('strval', $hoverBorderColor); |
|
| 316 | + } |
|
| 317 | + if (! is_array($hoverBorderColor)) { |
|
| 318 | + $hoverBorderColor = strval($hoverBorderColor); |
|
| 319 | + } |
|
| 320 | + |
|
| 321 | + $this->hoverBorderColor = $hoverBorderColor; |
|
| 322 | + |
|
| 323 | + return $this; |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + /** |
|
| 327 | + * @return int|int[] |
|
| 328 | + */ |
|
| 329 | + public function getHoverBorderWidth() |
|
| 330 | + { |
|
| 331 | + return $this->hoverBorderWidth; |
|
| 332 | + } |
|
| 333 | + |
|
| 334 | + /** |
|
| 335 | + * @param int|int[] $hoverBorderWidth |
|
| 336 | + * |
|
| 337 | + * @return $this |
|
| 338 | + */ |
|
| 339 | + public function setHoverBorderWidth($hoverBorderWidth) |
|
| 340 | + { |
|
| 341 | + if (is_array($hoverBorderWidth)) { |
|
| 342 | + $hoverBorderWidth = array_map('intval', $hoverBorderWidth); |
|
| 343 | + } |
|
| 344 | + if (! is_array($hoverBorderWidth)) { |
|
| 345 | + $hoverBorderWidth = intval($hoverBorderWidth); |
|
| 346 | + } |
|
| 347 | + |
|
| 348 | + $this->hoverBorderWidth = $hoverBorderWidth; |
|
| 349 | + |
|
| 350 | + return $this; |
|
| 351 | + } |
|
| 352 | + |
|
| 353 | + /** |
|
| 354 | + * |
|
| 355 | + */ |
|
| 356 | + public function jsonSerialize() |
|
| 357 | + { |
|
| 358 | + return Json::encode($this->getArrayCopy()); |
|
| 359 | + } |
|
| 360 | 360 | } |
@@ -11,53 +11,53 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class BubbleDataSet extends DataSet |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * @var string |
|
| 16 | - */ |
|
| 17 | - protected $pointStyle; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * @var int |
|
| 21 | - */ |
|
| 22 | - protected $radius; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @return string |
|
| 26 | - */ |
|
| 27 | - public function getPointStyle() |
|
| 28 | - { |
|
| 29 | - return $this->pointStyle; |
|
| 30 | - } |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * @param string $pointStyle |
|
| 34 | - * |
|
| 35 | - * @return \Halfpastfour\PHPChartJS\DataSet\BubbleDataSet |
|
| 36 | - */ |
|
| 37 | - public function setPointStyle($pointStyle) |
|
| 38 | - { |
|
| 39 | - $this->pointStyle = $pointStyle; |
|
| 40 | - |
|
| 41 | - return $this; |
|
| 42 | - } |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * @return int|null |
|
| 46 | - */ |
|
| 47 | - public function getRadius() |
|
| 48 | - { |
|
| 49 | - return $this->radius; |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - /** |
|
| 53 | - * @param int $radius |
|
| 54 | - * |
|
| 55 | - * @return \Halfpastfour\PHPChartJS\DataSet\BubbleDataSet |
|
| 56 | - */ |
|
| 57 | - public function setRadius($radius) |
|
| 58 | - { |
|
| 59 | - $this->radius = $radius; |
|
| 60 | - |
|
| 61 | - return $this; |
|
| 62 | - } |
|
| 14 | + /** |
|
| 15 | + * @var string |
|
| 16 | + */ |
|
| 17 | + protected $pointStyle; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * @var int |
|
| 21 | + */ |
|
| 22 | + protected $radius; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @return string |
|
| 26 | + */ |
|
| 27 | + public function getPointStyle() |
|
| 28 | + { |
|
| 29 | + return $this->pointStyle; |
|
| 30 | + } |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * @param string $pointStyle |
|
| 34 | + * |
|
| 35 | + * @return \Halfpastfour\PHPChartJS\DataSet\BubbleDataSet |
|
| 36 | + */ |
|
| 37 | + public function setPointStyle($pointStyle) |
|
| 38 | + { |
|
| 39 | + $this->pointStyle = $pointStyle; |
|
| 40 | + |
|
| 41 | + return $this; |
|
| 42 | + } |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * @return int|null |
|
| 46 | + */ |
|
| 47 | + public function getRadius() |
|
| 48 | + { |
|
| 49 | + return $this->radius; |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + /** |
|
| 53 | + * @param int $radius |
|
| 54 | + * |
|
| 55 | + * @return \Halfpastfour\PHPChartJS\DataSet\BubbleDataSet |
|
| 56 | + */ |
|
| 57 | + public function setRadius($radius) |
|
| 58 | + { |
|
| 59 | + $this->radius = $radius; |
|
| 60 | + |
|
| 61 | + return $this; |
|
| 62 | + } |
|
| 63 | 63 | } |
@@ -8,10 +8,10 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | interface ArraySerializableInterface |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * Should return an array containing all values. |
|
| 13 | - * |
|
| 14 | - * @return array |
|
| 15 | - */ |
|
| 16 | - public function getArrayCopy(); |
|
| 11 | + /** |
|
| 12 | + * Should return an array containing all values. |
|
| 13 | + * |
|
| 14 | + * @return array |
|
| 15 | + */ |
|
| 16 | + public function getArrayCopy(); |
|
| 17 | 17 | } |
@@ -8,28 +8,28 @@ |
||
| 8 | 8 | */ |
| 9 | 9 | trait ChartOwned |
| 10 | 10 | { |
| 11 | - /** |
|
| 12 | - * @var ChartInterface |
|
| 13 | - */ |
|
| 14 | - private $owner; |
|
| 11 | + /** |
|
| 12 | + * @var ChartInterface |
|
| 13 | + */ |
|
| 14 | + private $owner; |
|
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @param ChartInterface $chart |
|
| 18 | - * |
|
| 19 | - * @return $this |
|
| 20 | - */ |
|
| 21 | - public function setOwner(ChartInterface $chart) |
|
| 22 | - { |
|
| 23 | - $this->owner = $chart; |
|
| 16 | + /** |
|
| 17 | + * @param ChartInterface $chart |
|
| 18 | + * |
|
| 19 | + * @return $this |
|
| 20 | + */ |
|
| 21 | + public function setOwner(ChartInterface $chart) |
|
| 22 | + { |
|
| 23 | + $this->owner = $chart; |
|
| 24 | 24 | |
| 25 | - return $this; |
|
| 26 | - } |
|
| 25 | + return $this; |
|
| 26 | + } |
|
| 27 | 27 | |
| 28 | - /** |
|
| 29 | - * @return ChartInterface |
|
| 30 | - */ |
|
| 31 | - public function owner() |
|
| 32 | - { |
|
| 33 | - return $this->owner; |
|
| 34 | - } |
|
| 28 | + /** |
|
| 29 | + * @return ChartInterface |
|
| 30 | + */ |
|
| 31 | + public function owner() |
|
| 32 | + { |
|
| 33 | + return $this->owner; |
|
| 34 | + } |
|
| 35 | 35 | } |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | class Data extends ArrayAccess implements \JsonSerializable |
| 13 | 13 | { |
| 14 | - /** |
|
| 15 | - * @return string |
|
| 16 | - */ |
|
| 17 | - public function jsonSerialize() |
|
| 18 | - { |
|
| 19 | - return Json::encode($this->data); |
|
| 20 | - } |
|
| 14 | + /** |
|
| 15 | + * @return string |
|
| 16 | + */ |
|
| 17 | + public function jsonSerialize() |
|
| 18 | + { |
|
| 19 | + return Json::encode($this->data); |
|
| 20 | + } |
|
| 21 | 21 | } |
@@ -10,57 +10,57 @@ |
||
| 10 | 10 | */ |
| 11 | 11 | trait ArraySerializable |
| 12 | 12 | { |
| 13 | - /** |
|
| 14 | - * Will loop through class properties and try and assign their values to an array of data that will be returned. |
|
| 15 | - * |
|
| 16 | - * @return array |
|
| 17 | - * @throws \ReflectionException |
|
| 18 | - * @throws \Zend_Reflection_Exception |
|
| 19 | - */ |
|
| 20 | - public function getArrayCopy() |
|
| 21 | - { |
|
| 22 | - $data = []; |
|
| 23 | - $properties = get_object_vars($this); |
|
| 24 | - $reflectionClass = new \Zend_Reflection_Class($this); |
|
| 25 | - foreach ($properties as $property => $value) { |
|
| 26 | - // Skip property if it is not accessible |
|
| 27 | - if (! $reflectionClass->hasProperty($property)) { |
|
| 28 | - continue; |
|
| 29 | - } |
|
| 13 | + /** |
|
| 14 | + * Will loop through class properties and try and assign their values to an array of data that will be returned. |
|
| 15 | + * |
|
| 16 | + * @return array |
|
| 17 | + * @throws \ReflectionException |
|
| 18 | + * @throws \Zend_Reflection_Exception |
|
| 19 | + */ |
|
| 20 | + public function getArrayCopy() |
|
| 21 | + { |
|
| 22 | + $data = []; |
|
| 23 | + $properties = get_object_vars($this); |
|
| 24 | + $reflectionClass = new \Zend_Reflection_Class($this); |
|
| 25 | + foreach ($properties as $property => $value) { |
|
| 26 | + // Skip property if it is not accessible |
|
| 27 | + if (! $reflectionClass->hasProperty($property)) { |
|
| 28 | + continue; |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - // Only process properties that aren't null |
|
| 32 | - if (! is_null($value)) { |
|
| 33 | - // Gather phpdoc from property |
|
| 34 | - $phpDoc = $reflectionClass->getProperty($property)->getDocComment(); |
|
| 35 | - $type = $phpDoc->getTag('var')->getDescription(); |
|
| 36 | - $object = false; |
|
| 31 | + // Only process properties that aren't null |
|
| 32 | + if (! is_null($value)) { |
|
| 33 | + // Gather phpdoc from property |
|
| 34 | + $phpDoc = $reflectionClass->getProperty($property)->getDocComment(); |
|
| 35 | + $type = $phpDoc->getTag('var')->getDescription(); |
|
| 36 | + $object = false; |
|
| 37 | 37 | |
| 38 | - // Prepend 'get' to the getter method. |
|
| 39 | - $getter = 'get' . ucfirst($property); |
|
| 40 | - if (is_object($value) && ! $this->$property instanceof Expr) { |
|
| 41 | - $object = true; |
|
| 42 | - } |
|
| 38 | + // Prepend 'get' to the getter method. |
|
| 39 | + $getter = 'get' . ucfirst($property); |
|
| 40 | + if (is_object($value) && ! $this->$property instanceof Expr) { |
|
| 41 | + $object = true; |
|
| 42 | + } |
|
| 43 | 43 | |
| 44 | - // Determine whether the getter method is equal to the property name or is prepended by 'is' or 'get' |
|
| 45 | - if (strcmp($type, 'bool') === 0 || strcmp($type, 'boolean') === 0) { |
|
| 46 | - // Prepend 'is' to the getter method |
|
| 47 | - $getter = 'is' . ucfirst($property); |
|
| 48 | - } elseif (method_exists($this, $property) && is_object($value)) { |
|
| 49 | - // The getter method is equal to the property name and the value is an actual object |
|
| 50 | - $getter = $property; |
|
| 51 | - $object = true; |
|
| 52 | - } |
|
| 44 | + // Determine whether the getter method is equal to the property name or is prepended by 'is' or 'get' |
|
| 45 | + if (strcmp($type, 'bool') === 0 || strcmp($type, 'boolean') === 0) { |
|
| 46 | + // Prepend 'is' to the getter method |
|
| 47 | + $getter = 'is' . ucfirst($property); |
|
| 48 | + } elseif (method_exists($this, $property) && is_object($value)) { |
|
| 49 | + // The getter method is equal to the property name and the value is an actual object |
|
| 50 | + $getter = $property; |
|
| 51 | + $object = true; |
|
| 52 | + } |
|
| 53 | 53 | |
| 54 | - // Abort if the method does not exist |
|
| 55 | - if (! method_exists($this, $getter)) { |
|
| 56 | - continue; |
|
| 57 | - } |
|
| 54 | + // Abort if the method does not exist |
|
| 55 | + if (! method_exists($this, $getter)) { |
|
| 56 | + continue; |
|
| 57 | + } |
|
| 58 | 58 | |
| 59 | - // Assign the contents of the property to the data array |
|
| 60 | - $data[ $property ] = $object ? $this->$getter()->getArrayCopy() : $this->$getter(); |
|
| 61 | - } |
|
| 62 | - } |
|
| 59 | + // Assign the contents of the property to the data array |
|
| 60 | + $data[ $property ] = $object ? $this->$getter()->getArrayCopy() : $this->$getter(); |
|
| 61 | + } |
|
| 62 | + } |
|
| 63 | 63 | |
| 64 | - return $data; |
|
| 65 | - } |
|
| 64 | + return $data; |
|
| 65 | + } |
|
| 66 | 66 | } |
@@ -14,48 +14,48 @@ |
||
| 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 string |
|
| 54 | - * @throws \ReflectionException |
|
| 55 | - * @throws \Zend_Reflection_Exception |
|
| 56 | - */ |
|
| 57 | - public function jsonSerialize() |
|
| 58 | - { |
|
| 59 | - return Json::encode($this->getArrayCopy()); |
|
| 60 | - } |
|
| 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 string |
|
| 54 | + * @throws \ReflectionException |
|
| 55 | + * @throws \Zend_Reflection_Exception |
|
| 56 | + */ |
|
| 57 | + public function jsonSerialize() |
|
| 58 | + { |
|
| 59 | + return Json::encode($this->getArrayCopy()); |
|
| 60 | + } |
|
| 61 | 61 | } |
@@ -14,180 +14,180 @@ |
||
| 14 | 14 | */ |
| 15 | 15 | class Legend implements ArraySerializableInterface, \JsonSerializable |
| 16 | 16 | { |
| 17 | - use ArraySerializable; |
|
| 18 | - |
|
| 19 | - /** |
|
| 20 | - * @var bool |
|
| 21 | - */ |
|
| 22 | - private $display; |
|
| 23 | - |
|
| 24 | - /** |
|
| 25 | - * @var string |
|
| 26 | - */ |
|
| 27 | - private $position; |
|
| 28 | - |
|
| 29 | - /** |
|
| 30 | - * @var bool |
|
| 31 | - */ |
|
| 32 | - private $fullWidth; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * @var Expr |
|
| 36 | - */ |
|
| 37 | - private $onClick; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * @var Expr |
|
| 41 | - */ |
|
| 42 | - private $onHover; |
|
| 43 | - |
|
| 44 | - /** |
|
| 45 | - * @var LabelsCollection |
|
| 46 | - */ |
|
| 47 | - private $labels; |
|
| 48 | - |
|
| 49 | - /** |
|
| 50 | - * @var bool |
|
| 51 | - */ |
|
| 52 | - private $reverse; |
|
| 53 | - |
|
| 54 | - /** |
|
| 55 | - * @return bool |
|
| 56 | - */ |
|
| 57 | - public function isDisplay() |
|
| 58 | - { |
|
| 59 | - return $this->display; |
|
| 60 | - } |
|
| 61 | - |
|
| 62 | - /** |
|
| 63 | - * @param bool $display |
|
| 64 | - * |
|
| 65 | - * @return $this |
|
| 66 | - */ |
|
| 67 | - public function setDisplay($display) |
|
| 68 | - { |
|
| 69 | - $this->display = ! ! $display; |
|
| 70 | - |
|
| 71 | - return $this; |
|
| 72 | - } |
|
| 73 | - |
|
| 74 | - /** |
|
| 75 | - * @return string |
|
| 76 | - */ |
|
| 77 | - public function getPosition() |
|
| 78 | - { |
|
| 79 | - return $this->position; |
|
| 80 | - } |
|
| 81 | - |
|
| 82 | - /** |
|
| 83 | - * @param string $position |
|
| 84 | - * |
|
| 85 | - * @return $this |
|
| 86 | - */ |
|
| 87 | - public function setPosition($position) |
|
| 88 | - { |
|
| 89 | - $this->position = strval($position); |
|
| 90 | - |
|
| 91 | - return $this; |
|
| 92 | - } |
|
| 93 | - |
|
| 94 | - /** |
|
| 95 | - * @return bool |
|
| 96 | - */ |
|
| 97 | - public function isFullWidth() |
|
| 98 | - { |
|
| 99 | - return $this->fullWidth; |
|
| 100 | - } |
|
| 101 | - |
|
| 102 | - /** |
|
| 103 | - * @param bool $fullWidth |
|
| 104 | - * |
|
| 105 | - * @return $this |
|
| 106 | - */ |
|
| 107 | - public function setFullWidth($fullWidth) |
|
| 108 | - { |
|
| 109 | - $this->fullWidth = ! ! $fullWidth; |
|
| 110 | - |
|
| 111 | - return $this; |
|
| 112 | - } |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * @return Expr |
|
| 116 | - */ |
|
| 117 | - public function getOnClick() |
|
| 118 | - { |
|
| 119 | - return $this->onClick; |
|
| 120 | - } |
|
| 121 | - |
|
| 122 | - /** |
|
| 123 | - * @param string $onClick |
|
| 124 | - * |
|
| 125 | - * @return $this |
|
| 126 | - */ |
|
| 127 | - public function setOnClick($onClick) |
|
| 128 | - { |
|
| 129 | - $this->onClick = new Expr(strval($onClick)); |
|
| 130 | - |
|
| 131 | - return $this; |
|
| 132 | - } |
|
| 133 | - |
|
| 134 | - /** |
|
| 135 | - * @return Expr |
|
| 136 | - */ |
|
| 137 | - public function getOnHover() |
|
| 138 | - { |
|
| 139 | - return $this->onHover; |
|
| 140 | - } |
|
| 141 | - |
|
| 142 | - /** |
|
| 143 | - * @param string $onHover |
|
| 144 | - * |
|
| 145 | - * @return $this |
|
| 146 | - */ |
|
| 147 | - public function setOnHover($onHover) |
|
| 148 | - { |
|
| 149 | - $this->onHover = new Expr(strval($onHover)); |
|
| 150 | - |
|
| 151 | - return $this; |
|
| 152 | - } |
|
| 153 | - |
|
| 154 | - /** |
|
| 155 | - * @return LabelsCollection |
|
| 156 | - */ |
|
| 157 | - public function labels() |
|
| 158 | - { |
|
| 159 | - if (is_null($this->labels)) { |
|
| 160 | - $this->labels = new LabelsCollection(); |
|
| 161 | - } |
|
| 162 | - |
|
| 163 | - return $this->labels; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * @return bool |
|
| 168 | - */ |
|
| 169 | - public function isReverse() |
|
| 170 | - { |
|
| 171 | - return $this->reverse; |
|
| 172 | - } |
|
| 173 | - |
|
| 174 | - /** |
|
| 175 | - * @param bool $reverse |
|
| 176 | - * |
|
| 177 | - * @return $this |
|
| 178 | - */ |
|
| 179 | - public function setReverse($reverse) |
|
| 180 | - { |
|
| 181 | - $this->reverse = ! ! $reverse; |
|
| 182 | - |
|
| 183 | - return $this; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * @return string |
|
| 188 | - */ |
|
| 189 | - public function jsonSerialize() |
|
| 190 | - { |
|
| 191 | - return Json::encode($this->getArrayCopy(), false, [ 'enableJsonExprFinder' => true ]); |
|
| 192 | - } |
|
| 17 | + use ArraySerializable; |
|
| 18 | + |
|
| 19 | + /** |
|
| 20 | + * @var bool |
|
| 21 | + */ |
|
| 22 | + private $display; |
|
| 23 | + |
|
| 24 | + /** |
|
| 25 | + * @var string |
|
| 26 | + */ |
|
| 27 | + private $position; |
|
| 28 | + |
|
| 29 | + /** |
|
| 30 | + * @var bool |
|
| 31 | + */ |
|
| 32 | + private $fullWidth; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * @var Expr |
|
| 36 | + */ |
|
| 37 | + private $onClick; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * @var Expr |
|
| 41 | + */ |
|
| 42 | + private $onHover; |
|
| 43 | + |
|
| 44 | + /** |
|
| 45 | + * @var LabelsCollection |
|
| 46 | + */ |
|
| 47 | + private $labels; |
|
| 48 | + |
|
| 49 | + /** |
|
| 50 | + * @var bool |
|
| 51 | + */ |
|
| 52 | + private $reverse; |
|
| 53 | + |
|
| 54 | + /** |
|
| 55 | + * @return bool |
|
| 56 | + */ |
|
| 57 | + public function isDisplay() |
|
| 58 | + { |
|
| 59 | + return $this->display; |
|
| 60 | + } |
|
| 61 | + |
|
| 62 | + /** |
|
| 63 | + * @param bool $display |
|
| 64 | + * |
|
| 65 | + * @return $this |
|
| 66 | + */ |
|
| 67 | + public function setDisplay($display) |
|
| 68 | + { |
|
| 69 | + $this->display = ! ! $display; |
|
| 70 | + |
|
| 71 | + return $this; |
|
| 72 | + } |
|
| 73 | + |
|
| 74 | + /** |
|
| 75 | + * @return string |
|
| 76 | + */ |
|
| 77 | + public function getPosition() |
|
| 78 | + { |
|
| 79 | + return $this->position; |
|
| 80 | + } |
|
| 81 | + |
|
| 82 | + /** |
|
| 83 | + * @param string $position |
|
| 84 | + * |
|
| 85 | + * @return $this |
|
| 86 | + */ |
|
| 87 | + public function setPosition($position) |
|
| 88 | + { |
|
| 89 | + $this->position = strval($position); |
|
| 90 | + |
|
| 91 | + return $this; |
|
| 92 | + } |
|
| 93 | + |
|
| 94 | + /** |
|
| 95 | + * @return bool |
|
| 96 | + */ |
|
| 97 | + public function isFullWidth() |
|
| 98 | + { |
|
| 99 | + return $this->fullWidth; |
|
| 100 | + } |
|
| 101 | + |
|
| 102 | + /** |
|
| 103 | + * @param bool $fullWidth |
|
| 104 | + * |
|
| 105 | + * @return $this |
|
| 106 | + */ |
|
| 107 | + public function setFullWidth($fullWidth) |
|
| 108 | + { |
|
| 109 | + $this->fullWidth = ! ! $fullWidth; |
|
| 110 | + |
|
| 111 | + return $this; |
|
| 112 | + } |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * @return Expr |
|
| 116 | + */ |
|
| 117 | + public function getOnClick() |
|
| 118 | + { |
|
| 119 | + return $this->onClick; |
|
| 120 | + } |
|
| 121 | + |
|
| 122 | + /** |
|
| 123 | + * @param string $onClick |
|
| 124 | + * |
|
| 125 | + * @return $this |
|
| 126 | + */ |
|
| 127 | + public function setOnClick($onClick) |
|
| 128 | + { |
|
| 129 | + $this->onClick = new Expr(strval($onClick)); |
|
| 130 | + |
|
| 131 | + return $this; |
|
| 132 | + } |
|
| 133 | + |
|
| 134 | + /** |
|
| 135 | + * @return Expr |
|
| 136 | + */ |
|
| 137 | + public function getOnHover() |
|
| 138 | + { |
|
| 139 | + return $this->onHover; |
|
| 140 | + } |
|
| 141 | + |
|
| 142 | + /** |
|
| 143 | + * @param string $onHover |
|
| 144 | + * |
|
| 145 | + * @return $this |
|
| 146 | + */ |
|
| 147 | + public function setOnHover($onHover) |
|
| 148 | + { |
|
| 149 | + $this->onHover = new Expr(strval($onHover)); |
|
| 150 | + |
|
| 151 | + return $this; |
|
| 152 | + } |
|
| 153 | + |
|
| 154 | + /** |
|
| 155 | + * @return LabelsCollection |
|
| 156 | + */ |
|
| 157 | + public function labels() |
|
| 158 | + { |
|
| 159 | + if (is_null($this->labels)) { |
|
| 160 | + $this->labels = new LabelsCollection(); |
|
| 161 | + } |
|
| 162 | + |
|
| 163 | + return $this->labels; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * @return bool |
|
| 168 | + */ |
|
| 169 | + public function isReverse() |
|
| 170 | + { |
|
| 171 | + return $this->reverse; |
|
| 172 | + } |
|
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * @param bool $reverse |
|
| 176 | + * |
|
| 177 | + * @return $this |
|
| 178 | + */ |
|
| 179 | + public function setReverse($reverse) |
|
| 180 | + { |
|
| 181 | + $this->reverse = ! ! $reverse; |
|
| 182 | + |
|
| 183 | + return $this; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * @return string |
|
| 188 | + */ |
|
| 189 | + public function jsonSerialize() |
|
| 190 | + { |
|
| 191 | + return Json::encode($this->getArrayCopy(), false, [ 'enableJsonExprFinder' => true ]); |
|
| 192 | + } |
|
| 193 | 193 | } |
@@ -13,213 +13,213 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class Labels implements ArraySerializableInterface, \JsonSerializable |
| 15 | 15 | { |
| 16 | - use ArraySerializable; |
|
| 17 | - |
|
| 18 | - /** |
|
| 19 | - * @var int |
|
| 20 | - */ |
|
| 21 | - private $boxWidth; |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * @var int |
|
| 25 | - */ |
|
| 26 | - private $fontSize; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * @var string |
|
| 30 | - */ |
|
| 31 | - private $fontStyle; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * @var string |
|
| 35 | - */ |
|
| 36 | - private $fontColor; |
|
| 37 | - |
|
| 38 | - /** |
|
| 39 | - * @var string |
|
| 40 | - */ |
|
| 41 | - private $fontFamily; |
|
| 42 | - |
|
| 43 | - /** |
|
| 44 | - * @var int |
|
| 45 | - */ |
|
| 46 | - private $padding; |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * @var Expr |
|
| 50 | - */ |
|
| 51 | - private $generateLabels; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * @var bool |
|
| 55 | - */ |
|
| 56 | - private $usePointStyle; |
|
| 57 | - |
|
| 58 | - /** |
|
| 59 | - * @return int |
|
| 60 | - */ |
|
| 61 | - public function getBoxWidth() |
|
| 62 | - { |
|
| 63 | - return $this->boxWidth; |
|
| 64 | - } |
|
| 65 | - |
|
| 66 | - /** |
|
| 67 | - * @param int $boxWidth |
|
| 68 | - * |
|
| 69 | - * @return Labels |
|
| 70 | - */ |
|
| 71 | - public function setBoxWidth($boxWidth) |
|
| 72 | - { |
|
| 73 | - $this->boxWidth = intval($boxWidth); |
|
| 74 | - |
|
| 75 | - return $this; |
|
| 76 | - } |
|
| 77 | - |
|
| 78 | - /** |
|
| 79 | - * @return mixed |
|
| 80 | - */ |
|
| 81 | - public function getFontSize() |
|
| 82 | - { |
|
| 83 | - return $this->fontSize; |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - /** |
|
| 87 | - * @param int $fontSize |
|
| 88 | - * |
|
| 89 | - * @return Labels |
|
| 90 | - */ |
|
| 91 | - public function setFontSize($fontSize) |
|
| 92 | - { |
|
| 93 | - $this->fontSize = intval($fontSize); |
|
| 94 | - |
|
| 95 | - return $this; |
|
| 96 | - } |
|
| 97 | - |
|
| 98 | - /** |
|
| 99 | - * @return string |
|
| 100 | - */ |
|
| 101 | - public function getFontStyle() |
|
| 102 | - { |
|
| 103 | - return $this->fontStyle; |
|
| 104 | - } |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * @param string $fontStyle |
|
| 108 | - * |
|
| 109 | - * @return Labels |
|
| 110 | - */ |
|
| 111 | - public function setFontStyle($fontStyle) |
|
| 112 | - { |
|
| 113 | - $this->fontStyle = strval($fontStyle); |
|
| 114 | - |
|
| 115 | - return $this; |
|
| 116 | - } |
|
| 117 | - |
|
| 118 | - /** |
|
| 119 | - * @return string |
|
| 120 | - */ |
|
| 121 | - public function getFontColor() |
|
| 122 | - { |
|
| 123 | - return $this->fontColor; |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - /** |
|
| 127 | - * @param string $fontColor |
|
| 128 | - * |
|
| 129 | - * @return Labels |
|
| 130 | - */ |
|
| 131 | - public function setFontColor($fontColor) |
|
| 132 | - { |
|
| 133 | - $this->fontColor = strval($fontColor); |
|
| 134 | - |
|
| 135 | - return $this; |
|
| 136 | - } |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * @return string |
|
| 140 | - */ |
|
| 141 | - public function getFontFamily() |
|
| 142 | - { |
|
| 143 | - return $this->fontFamily; |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - /** |
|
| 147 | - * @param string $fontFamily |
|
| 148 | - * |
|
| 149 | - * @return Labels |
|
| 150 | - */ |
|
| 151 | - public function setFontFamily($fontFamily) |
|
| 152 | - { |
|
| 153 | - $this->fontFamily = strval($fontFamily); |
|
| 154 | - |
|
| 155 | - return $this; |
|
| 156 | - } |
|
| 157 | - |
|
| 158 | - /** |
|
| 159 | - * @return int |
|
| 160 | - */ |
|
| 161 | - public function getPadding() |
|
| 162 | - { |
|
| 163 | - return $this->padding; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - /** |
|
| 167 | - * @param int $padding |
|
| 168 | - * |
|
| 169 | - * @return Labels |
|
| 170 | - */ |
|
| 171 | - public function setPadding($padding) |
|
| 172 | - { |
|
| 173 | - $this->padding = intval($padding); |
|
| 174 | - |
|
| 175 | - return $this; |
|
| 176 | - } |
|
| 177 | - |
|
| 178 | - /** |
|
| 179 | - * @return Expr |
|
| 180 | - */ |
|
| 181 | - public function getGenerateLabels() |
|
| 182 | - { |
|
| 183 | - return $this->generateLabels; |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - /** |
|
| 187 | - * @param string $generateLabels |
|
| 188 | - * |
|
| 189 | - * @return Labels |
|
| 190 | - */ |
|
| 191 | - public function setGenerateLabels($generateLabels) |
|
| 192 | - { |
|
| 193 | - $this->generateLabels = new Expr(strval($generateLabels)); |
|
| 194 | - |
|
| 195 | - return $this; |
|
| 196 | - } |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * @return bool |
|
| 200 | - */ |
|
| 201 | - public function isUsePointStyle() |
|
| 202 | - { |
|
| 203 | - return $this->usePointStyle; |
|
| 204 | - } |
|
| 205 | - |
|
| 206 | - /** |
|
| 207 | - * @param bool $usePointStyle |
|
| 208 | - * |
|
| 209 | - * @return Labels |
|
| 210 | - */ |
|
| 211 | - public function setUsePointStyle($usePointStyle) |
|
| 212 | - { |
|
| 213 | - $this->usePointStyle = ! ! $usePointStyle; |
|
| 214 | - |
|
| 215 | - return $this; |
|
| 216 | - } |
|
| 217 | - |
|
| 218 | - /** |
|
| 219 | - * @return string |
|
| 220 | - */ |
|
| 221 | - public function jsonSerialize() |
|
| 222 | - { |
|
| 223 | - return Json::encode($this->getArrayCopy(), false, [ 'enableJsonExprFinder' => true ]); |
|
| 224 | - } |
|
| 16 | + use ArraySerializable; |
|
| 17 | + |
|
| 18 | + /** |
|
| 19 | + * @var int |
|
| 20 | + */ |
|
| 21 | + private $boxWidth; |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * @var int |
|
| 25 | + */ |
|
| 26 | + private $fontSize; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * @var string |
|
| 30 | + */ |
|
| 31 | + private $fontStyle; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * @var string |
|
| 35 | + */ |
|
| 36 | + private $fontColor; |
|
| 37 | + |
|
| 38 | + /** |
|
| 39 | + * @var string |
|
| 40 | + */ |
|
| 41 | + private $fontFamily; |
|
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * @var int |
|
| 45 | + */ |
|
| 46 | + private $padding; |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * @var Expr |
|
| 50 | + */ |
|
| 51 | + private $generateLabels; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * @var bool |
|
| 55 | + */ |
|
| 56 | + private $usePointStyle; |
|
| 57 | + |
|
| 58 | + /** |
|
| 59 | + * @return int |
|
| 60 | + */ |
|
| 61 | + public function getBoxWidth() |
|
| 62 | + { |
|
| 63 | + return $this->boxWidth; |
|
| 64 | + } |
|
| 65 | + |
|
| 66 | + /** |
|
| 67 | + * @param int $boxWidth |
|
| 68 | + * |
|
| 69 | + * @return Labels |
|
| 70 | + */ |
|
| 71 | + public function setBoxWidth($boxWidth) |
|
| 72 | + { |
|
| 73 | + $this->boxWidth = intval($boxWidth); |
|
| 74 | + |
|
| 75 | + return $this; |
|
| 76 | + } |
|
| 77 | + |
|
| 78 | + /** |
|
| 79 | + * @return mixed |
|
| 80 | + */ |
|
| 81 | + public function getFontSize() |
|
| 82 | + { |
|
| 83 | + return $this->fontSize; |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + /** |
|
| 87 | + * @param int $fontSize |
|
| 88 | + * |
|
| 89 | + * @return Labels |
|
| 90 | + */ |
|
| 91 | + public function setFontSize($fontSize) |
|
| 92 | + { |
|
| 93 | + $this->fontSize = intval($fontSize); |
|
| 94 | + |
|
| 95 | + return $this; |
|
| 96 | + } |
|
| 97 | + |
|
| 98 | + /** |
|
| 99 | + * @return string |
|
| 100 | + */ |
|
| 101 | + public function getFontStyle() |
|
| 102 | + { |
|
| 103 | + return $this->fontStyle; |
|
| 104 | + } |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * @param string $fontStyle |
|
| 108 | + * |
|
| 109 | + * @return Labels |
|
| 110 | + */ |
|
| 111 | + public function setFontStyle($fontStyle) |
|
| 112 | + { |
|
| 113 | + $this->fontStyle = strval($fontStyle); |
|
| 114 | + |
|
| 115 | + return $this; |
|
| 116 | + } |
|
| 117 | + |
|
| 118 | + /** |
|
| 119 | + * @return string |
|
| 120 | + */ |
|
| 121 | + public function getFontColor() |
|
| 122 | + { |
|
| 123 | + return $this->fontColor; |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + /** |
|
| 127 | + * @param string $fontColor |
|
| 128 | + * |
|
| 129 | + * @return Labels |
|
| 130 | + */ |
|
| 131 | + public function setFontColor($fontColor) |
|
| 132 | + { |
|
| 133 | + $this->fontColor = strval($fontColor); |
|
| 134 | + |
|
| 135 | + return $this; |
|
| 136 | + } |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * @return string |
|
| 140 | + */ |
|
| 141 | + public function getFontFamily() |
|
| 142 | + { |
|
| 143 | + return $this->fontFamily; |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + /** |
|
| 147 | + * @param string $fontFamily |
|
| 148 | + * |
|
| 149 | + * @return Labels |
|
| 150 | + */ |
|
| 151 | + public function setFontFamily($fontFamily) |
|
| 152 | + { |
|
| 153 | + $this->fontFamily = strval($fontFamily); |
|
| 154 | + |
|
| 155 | + return $this; |
|
| 156 | + } |
|
| 157 | + |
|
| 158 | + /** |
|
| 159 | + * @return int |
|
| 160 | + */ |
|
| 161 | + public function getPadding() |
|
| 162 | + { |
|
| 163 | + return $this->padding; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + /** |
|
| 167 | + * @param int $padding |
|
| 168 | + * |
|
| 169 | + * @return Labels |
|
| 170 | + */ |
|
| 171 | + public function setPadding($padding) |
|
| 172 | + { |
|
| 173 | + $this->padding = intval($padding); |
|
| 174 | + |
|
| 175 | + return $this; |
|
| 176 | + } |
|
| 177 | + |
|
| 178 | + /** |
|
| 179 | + * @return Expr |
|
| 180 | + */ |
|
| 181 | + public function getGenerateLabels() |
|
| 182 | + { |
|
| 183 | + return $this->generateLabels; |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + /** |
|
| 187 | + * @param string $generateLabels |
|
| 188 | + * |
|
| 189 | + * @return Labels |
|
| 190 | + */ |
|
| 191 | + public function setGenerateLabels($generateLabels) |
|
| 192 | + { |
|
| 193 | + $this->generateLabels = new Expr(strval($generateLabels)); |
|
| 194 | + |
|
| 195 | + return $this; |
|
| 196 | + } |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * @return bool |
|
| 200 | + */ |
|
| 201 | + public function isUsePointStyle() |
|
| 202 | + { |
|
| 203 | + return $this->usePointStyle; |
|
| 204 | + } |
|
| 205 | + |
|
| 206 | + /** |
|
| 207 | + * @param bool $usePointStyle |
|
| 208 | + * |
|
| 209 | + * @return Labels |
|
| 210 | + */ |
|
| 211 | + public function setUsePointStyle($usePointStyle) |
|
| 212 | + { |
|
| 213 | + $this->usePointStyle = ! ! $usePointStyle; |
|
| 214 | + |
|
| 215 | + return $this; |
|
| 216 | + } |
|
| 217 | + |
|
| 218 | + /** |
|
| 219 | + * @return string |
|
| 220 | + */ |
|
| 221 | + public function jsonSerialize() |
|
| 222 | + { |
|
| 223 | + return Json::encode($this->getArrayCopy(), false, [ 'enableJsonExprFinder' => true ]); |
|
| 224 | + } |
|
| 225 | 225 | } |