1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Halfpastfour\PHPChartJS\Options\Scales; |
4
|
|
|
|
5
|
|
|
use Halfpastfour\PHPChartJS\ArraySerializableInterface; |
6
|
|
|
use Halfpastfour\PHPChartJS\Delegate\ArraySerializable; |
7
|
|
|
use JsonSerializable; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class ScaleLabel |
11
|
|
|
* |
12
|
|
|
* @package Halfpastfour\PHPChartJS\Options\Scales |
13
|
|
|
*/ |
14
|
|
|
class ScaleLabel implements ArraySerializableInterface, JsonSerializable |
15
|
|
|
{ |
16
|
|
|
use ArraySerializable; |
17
|
|
|
|
18
|
|
|
/** |
19
|
|
|
* @var bool |
20
|
|
|
*/ |
21
|
|
|
private $display; |
22
|
|
|
|
23
|
|
|
/** |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
private $labelString; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* @var string |
30
|
|
|
*/ |
31
|
|
|
private $fontColor; |
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @var string |
35
|
|
|
*/ |
36
|
|
|
private $fontFamily; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @var int |
40
|
|
|
*/ |
41
|
|
|
private $fontSize; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var string |
45
|
|
|
*/ |
46
|
|
|
private $fontStyle; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @return bool |
50
|
|
|
*/ |
51
|
|
|
public function isDisplay() |
52
|
|
|
{ |
53
|
|
|
return $this->display; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @param bool $display |
58
|
|
|
* |
59
|
|
|
* @return $this |
60
|
|
|
*/ |
61
|
|
|
public function setDisplay($display) |
62
|
|
|
{ |
63
|
|
|
$this->display = ! ! $display; |
64
|
|
|
|
65
|
|
|
return $this; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return string |
70
|
|
|
*/ |
71
|
|
|
public function getLabelString() |
72
|
|
|
{ |
73
|
|
|
return $this->labelString; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param string $labelString |
78
|
|
|
* |
79
|
|
|
* @return $this |
80
|
|
|
*/ |
81
|
|
|
public function setLabelString($labelString) |
82
|
|
|
{ |
83
|
|
|
$this->labelString = strval($labelString); |
84
|
|
|
|
85
|
|
|
return $this; |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* @return string |
90
|
|
|
*/ |
91
|
|
|
public function getFontColor() |
92
|
|
|
{ |
93
|
|
|
return $this->fontColor; |
94
|
|
|
} |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* @param string $fontColor |
98
|
|
|
* |
99
|
|
|
* @return $this |
100
|
|
|
*/ |
101
|
|
|
public function setFontColor($fontColor) |
102
|
|
|
{ |
103
|
|
|
$this->fontColor = strval($fontColor); |
104
|
|
|
|
105
|
|
|
return $this; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @return string |
110
|
|
|
*/ |
111
|
|
|
public function getFontFamily() |
112
|
|
|
{ |
113
|
|
|
return $this->fontFamily; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param string $fontFamily |
118
|
|
|
* |
119
|
|
|
* @return $this |
120
|
|
|
*/ |
121
|
|
|
public function setFontFamily($fontFamily) |
122
|
|
|
{ |
123
|
|
|
$this->fontFamily = strval($fontFamily); |
124
|
|
|
|
125
|
|
|
return $this; |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return int |
130
|
|
|
*/ |
131
|
|
|
public function getFontSize() |
132
|
|
|
{ |
133
|
|
|
return $this->fontSize; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @param int $fontSize |
138
|
|
|
* |
139
|
|
|
* @return $this |
140
|
|
|
*/ |
141
|
|
|
public function setFontSize($fontSize) |
142
|
|
|
{ |
143
|
|
|
$this->fontSize = intval($fontSize); |
144
|
|
|
|
145
|
|
|
return $this; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* @return string |
150
|
|
|
*/ |
151
|
|
|
public function getFontStyle() |
152
|
|
|
{ |
153
|
|
|
return $this->fontStyle; |
154
|
|
|
} |
155
|
|
|
|
156
|
|
|
/** |
157
|
|
|
* @param string $fontStyle |
158
|
|
|
* |
159
|
|
|
* @return $this |
160
|
|
|
*/ |
161
|
|
|
public function setFontStyle($fontStyle) |
162
|
|
|
{ |
163
|
|
|
$this->fontStyle = strval($fontStyle); |
164
|
|
|
|
165
|
|
|
return $this; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @return array |
170
|
|
|
*/ |
171
|
|
|
public function jsonSerialize() |
172
|
|
|
{ |
173
|
|
|
return $this->getArrayCopy(); |
174
|
|
|
} |
175
|
|
|
} |
176
|
|
|
|