1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace Halfpastfour\PHPChartJS\Options\Tooltips; |
4
|
|
|
|
5
|
|
|
use Halfpastfour\PHPChartJS\ArraySerializableInterface; |
6
|
|
|
use Halfpastfour\PHPChartJS\Delegate\ArraySerializable; |
7
|
|
|
use JsonSerializable; |
8
|
|
|
use Laminas\Json\Expr; |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* Class Callbacks |
12
|
|
|
* |
13
|
|
|
* @package Halfpastfour\PHPChartJS\Tooltips |
14
|
|
|
*/ |
15
|
|
|
class Callbacks implements ArraySerializableInterface, JsonSerializable |
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
|
|
|
} |
326
|
|
|
} |
327
|
|
|
|