halfpastfouram /
phpchartjs
| 1 | <?php |
||
| 2 | |||
| 3 | namespace Halfpastfour\PHPChartJS\Options\Elements; |
||
| 4 | |||
| 5 | use Halfpastfour\PHPChartJS\ArraySerializableInterface; |
||
| 6 | use Halfpastfour\PHPChartJS\Delegate\ArraySerializable; |
||
| 7 | use JsonSerializable; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class Arc |
||
| 11 | * |
||
| 12 | * @package Halfpastfour\PHPChartJS\Options\Elements |
||
| 13 | */ |
||
| 14 | class Arc implements ArraySerializableInterface, JsonSerializable |
||
| 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); |
||
|
0 ignored issues
–
show
introduced
by
Loading history...
|
|||
| 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); |
||
|
0 ignored issues
–
show
|
|||
| 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 | } |
||
| 110 |