1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpOffice\PhpSpreadsheet\Chart; |
4
|
|
|
|
5
|
|
|
class Layout |
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* layoutTarget. |
9
|
|
|
* |
10
|
|
|
* @var string |
11
|
|
|
*/ |
12
|
|
|
private $layoutTarget; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* X Mode. |
16
|
|
|
* |
17
|
|
|
* @var string |
18
|
|
|
*/ |
19
|
|
|
private $xMode; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Y Mode. |
23
|
|
|
* |
24
|
|
|
* @var string |
25
|
|
|
*/ |
26
|
|
|
private $yMode; |
27
|
|
|
|
28
|
|
|
/** |
29
|
|
|
* X-Position. |
30
|
|
|
* |
31
|
|
|
* @var float |
32
|
|
|
*/ |
33
|
|
|
private $xPos; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* Y-Position. |
37
|
|
|
* |
38
|
|
|
* @var float |
39
|
|
|
*/ |
40
|
|
|
private $yPos; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* width. |
44
|
|
|
* |
45
|
|
|
* @var float |
46
|
|
|
*/ |
47
|
|
|
private $width; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* height. |
51
|
|
|
* |
52
|
|
|
* @var float |
53
|
|
|
*/ |
54
|
|
|
private $height; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* show legend key |
58
|
|
|
* Specifies that legend keys should be shown in data labels. |
59
|
|
|
* |
60
|
|
|
* @var bool |
61
|
|
|
*/ |
62
|
|
|
private $showLegendKey; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* show value |
66
|
|
|
* Specifies that the value should be shown in a data label. |
67
|
|
|
* |
68
|
|
|
* @var bool |
69
|
|
|
*/ |
70
|
|
|
private $showVal; |
71
|
|
|
|
72
|
|
|
/** |
73
|
|
|
* show category name |
74
|
|
|
* Specifies that the category name should be shown in the data label. |
75
|
|
|
* |
76
|
|
|
* @var bool |
77
|
|
|
*/ |
78
|
|
|
private $showCatName; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* show data series name |
82
|
|
|
* Specifies that the series name should be shown in the data label. |
83
|
|
|
* |
84
|
|
|
* @var bool |
85
|
|
|
*/ |
86
|
|
|
private $showSerName; |
87
|
|
|
|
88
|
|
|
/** |
89
|
|
|
* show percentage |
90
|
|
|
* Specifies that the percentage should be shown in the data label. |
91
|
|
|
* |
92
|
|
|
* @var bool |
93
|
|
|
*/ |
94
|
|
|
private $showPercent; |
95
|
|
|
|
96
|
|
|
/** |
97
|
|
|
* show bubble size. |
98
|
|
|
* |
99
|
|
|
* @var bool |
100
|
|
|
*/ |
101
|
|
|
private $showBubbleSize; |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* show leader lines |
105
|
|
|
* Specifies that leader lines should be shown for the data label. |
106
|
|
|
* |
107
|
|
|
* @var bool |
108
|
|
|
*/ |
109
|
|
|
private $showLeaderLines; |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* Create a new Layout. |
113
|
|
|
* |
114
|
|
|
* @param array $layout |
115
|
|
|
*/ |
116
|
6 |
|
public function __construct(array $layout = []) |
117
|
|
|
{ |
118
|
6 |
|
if (isset($layout['layoutTarget'])) { |
119
|
2 |
|
$this->layoutTarget = $layout['layoutTarget']; |
120
|
|
|
} |
121
|
6 |
|
if (isset($layout['xMode'])) { |
122
|
2 |
|
$this->xMode = $layout['xMode']; |
123
|
|
|
} |
124
|
6 |
|
if (isset($layout['yMode'])) { |
125
|
2 |
|
$this->yMode = $layout['yMode']; |
126
|
|
|
} |
127
|
6 |
|
if (isset($layout['x'])) { |
128
|
2 |
|
$this->xPos = (float) $layout['x']; |
129
|
|
|
} |
130
|
6 |
|
if (isset($layout['y'])) { |
131
|
2 |
|
$this->yPos = (float) $layout['y']; |
132
|
|
|
} |
133
|
6 |
|
if (isset($layout['w'])) { |
134
|
2 |
|
$this->width = (float) $layout['w']; |
135
|
|
|
} |
136
|
6 |
|
if (isset($layout['h'])) { |
137
|
2 |
|
$this->height = (float) $layout['h']; |
138
|
|
|
} |
139
|
6 |
|
} |
140
|
|
|
|
141
|
|
|
/** |
142
|
|
|
* Get Layout Target. |
143
|
|
|
* |
144
|
|
|
* @return string |
145
|
|
|
*/ |
146
|
4 |
|
public function getLayoutTarget() |
147
|
|
|
{ |
148
|
4 |
|
return $this->layoutTarget; |
149
|
|
|
} |
150
|
|
|
|
151
|
|
|
/** |
152
|
|
|
* Set Layout Target. |
153
|
|
|
* |
154
|
|
|
* @param string $value |
155
|
|
|
* |
156
|
|
|
* @return Layout |
157
|
|
|
*/ |
158
|
2 |
|
public function setLayoutTarget($value) |
159
|
|
|
{ |
160
|
2 |
|
$this->layoutTarget = $value; |
161
|
|
|
|
162
|
2 |
|
return $this; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Get X-Mode. |
167
|
|
|
* |
168
|
|
|
* @return string |
169
|
|
|
*/ |
170
|
3 |
|
public function getXMode() |
171
|
|
|
{ |
172
|
3 |
|
return $this->xMode; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* Set X-Mode. |
177
|
|
|
* |
178
|
|
|
* @param X-Mode $value |
|
|
|
|
179
|
|
|
* |
180
|
|
|
* @return Layout |
181
|
|
|
*/ |
182
|
|
|
public function setXMode($value) |
183
|
|
|
{ |
184
|
|
|
$this->xMode = $value; |
185
|
|
|
|
186
|
|
|
return $this; |
187
|
|
|
} |
188
|
|
|
|
189
|
|
|
/** |
190
|
|
|
* Get Y-Mode. |
191
|
|
|
* |
192
|
|
|
* @return string |
193
|
|
|
*/ |
194
|
3 |
|
public function getYMode() |
195
|
|
|
{ |
196
|
3 |
|
return $this->yMode; |
197
|
|
|
} |
198
|
|
|
|
199
|
|
|
/** |
200
|
|
|
* Set Y-Mode. |
201
|
|
|
* |
202
|
|
|
* @param Y-Mode $value |
|
|
|
|
203
|
|
|
* |
204
|
|
|
* @return Layout |
205
|
|
|
*/ |
206
|
|
|
public function setYMode($value) |
207
|
|
|
{ |
208
|
|
|
$this->yMode = $value; |
209
|
|
|
|
210
|
|
|
return $this; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* Get X-Position. |
215
|
|
|
* |
216
|
|
|
* @return number |
217
|
|
|
*/ |
218
|
3 |
|
public function getXPosition() |
219
|
|
|
{ |
220
|
3 |
|
return $this->xPos; |
221
|
|
|
} |
222
|
|
|
|
223
|
|
|
/** |
224
|
|
|
* Set X-Position. |
225
|
|
|
* |
226
|
|
|
* @param X-Position $value |
|
|
|
|
227
|
|
|
* |
228
|
|
|
* @return Layout |
229
|
|
|
*/ |
230
|
|
|
public function setXPosition($value) |
231
|
|
|
{ |
232
|
|
|
$this->xPos = $value; |
233
|
|
|
|
234
|
|
|
return $this; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* Get Y-Position. |
239
|
|
|
* |
240
|
|
|
* @return number |
241
|
|
|
*/ |
242
|
3 |
|
public function getYPosition() |
243
|
|
|
{ |
244
|
3 |
|
return $this->yPos; |
245
|
|
|
} |
246
|
|
|
|
247
|
|
|
/** |
248
|
|
|
* Set Y-Position. |
249
|
|
|
* |
250
|
|
|
* @param Y-Position $value |
|
|
|
|
251
|
|
|
* |
252
|
|
|
* @return Layout |
253
|
|
|
*/ |
254
|
|
|
public function setYPosition($value) |
255
|
|
|
{ |
256
|
|
|
$this->yPos = $value; |
257
|
|
|
|
258
|
|
|
return $this; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* Get Width. |
263
|
|
|
* |
264
|
|
|
* @return number |
265
|
|
|
*/ |
266
|
3 |
|
public function getWidth() |
267
|
|
|
{ |
268
|
3 |
|
return $this->width; |
269
|
|
|
} |
270
|
|
|
|
271
|
|
|
/** |
272
|
|
|
* Set Width. |
273
|
|
|
* |
274
|
|
|
* @param float $value |
275
|
|
|
* |
276
|
|
|
* @return Layout |
277
|
|
|
*/ |
278
|
|
|
public function setWidth($value) |
279
|
|
|
{ |
280
|
|
|
$this->width = $value; |
281
|
|
|
|
282
|
|
|
return $this; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
/** |
286
|
|
|
* Get Height. |
287
|
|
|
* |
288
|
|
|
* @return number |
289
|
|
|
*/ |
290
|
3 |
|
public function getHeight() |
291
|
|
|
{ |
292
|
3 |
|
return $this->height; |
293
|
|
|
} |
294
|
|
|
|
295
|
|
|
/** |
296
|
|
|
* Set Height. |
297
|
|
|
* |
298
|
|
|
* @param float $value |
299
|
|
|
* |
300
|
|
|
* @return Layout |
301
|
|
|
*/ |
302
|
|
|
public function setHeight($value) |
303
|
|
|
{ |
304
|
|
|
$this->height = $value; |
305
|
|
|
|
306
|
|
|
return $this; |
307
|
|
|
} |
308
|
|
|
|
309
|
|
|
/** |
310
|
|
|
* Get show legend key. |
311
|
|
|
* |
312
|
|
|
* @return bool |
313
|
|
|
*/ |
314
|
3 |
|
public function getShowLegendKey() |
315
|
|
|
{ |
316
|
3 |
|
return $this->showLegendKey; |
317
|
|
|
} |
318
|
|
|
|
319
|
|
|
/** |
320
|
|
|
* Set show legend key |
321
|
|
|
* Specifies that legend keys should be shown in data labels. |
322
|
|
|
* |
323
|
|
|
* @param bool $value Show legend key |
324
|
|
|
* |
325
|
|
|
* @return Layout |
326
|
|
|
*/ |
327
|
|
|
public function setShowLegendKey($value) |
328
|
|
|
{ |
329
|
|
|
$this->showLegendKey = $value; |
330
|
|
|
|
331
|
|
|
return $this; |
332
|
|
|
} |
333
|
|
|
|
334
|
|
|
/** |
335
|
|
|
* Get show value. |
336
|
|
|
* |
337
|
|
|
* @return bool |
338
|
|
|
*/ |
339
|
3 |
|
public function getShowVal() |
340
|
|
|
{ |
341
|
3 |
|
return $this->showVal; |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* Set show val |
346
|
|
|
* Specifies that the value should be shown in data labels. |
347
|
|
|
* |
348
|
|
|
* @param bool $value Show val |
349
|
|
|
* |
350
|
|
|
* @return Layout |
351
|
|
|
*/ |
352
|
3 |
|
public function setShowVal($value) |
353
|
|
|
{ |
354
|
3 |
|
$this->showVal = $value; |
355
|
|
|
|
356
|
3 |
|
return $this; |
357
|
|
|
} |
358
|
|
|
|
359
|
|
|
/** |
360
|
|
|
* Get show category name. |
361
|
|
|
* |
362
|
|
|
* @return bool |
363
|
|
|
*/ |
364
|
3 |
|
public function getShowCatName() |
365
|
|
|
{ |
366
|
3 |
|
return $this->showCatName; |
367
|
|
|
} |
368
|
|
|
|
369
|
|
|
/** |
370
|
|
|
* Set show cat name |
371
|
|
|
* Specifies that the category name should be shown in data labels. |
372
|
|
|
* |
373
|
|
|
* @param bool $value Show cat name |
374
|
|
|
* |
375
|
|
|
* @return Layout |
376
|
|
|
*/ |
377
|
3 |
|
public function setShowCatName($value) |
378
|
|
|
{ |
379
|
3 |
|
$this->showCatName = $value; |
380
|
|
|
|
381
|
3 |
|
return $this; |
382
|
|
|
} |
383
|
|
|
|
384
|
|
|
/** |
385
|
|
|
* Get show data series name. |
386
|
|
|
* |
387
|
|
|
* @return bool |
388
|
|
|
*/ |
389
|
3 |
|
public function getShowSerName() |
390
|
|
|
{ |
391
|
3 |
|
return $this->showSerName; |
392
|
|
|
} |
393
|
|
|
|
394
|
|
|
/** |
395
|
|
|
* Set show ser name |
396
|
|
|
* Specifies that the series name should be shown in data labels. |
397
|
|
|
* |
398
|
|
|
* @param bool $value Show series name |
399
|
|
|
* |
400
|
|
|
* @return Layout |
401
|
|
|
*/ |
402
|
2 |
|
public function setShowSerName($value) |
403
|
|
|
{ |
404
|
2 |
|
$this->showSerName = $value; |
405
|
|
|
|
406
|
2 |
|
return $this; |
407
|
|
|
} |
408
|
|
|
|
409
|
|
|
/** |
410
|
|
|
* Get show percentage. |
411
|
|
|
* |
412
|
|
|
* @return bool |
413
|
|
|
*/ |
414
|
3 |
|
public function getShowPercent() |
415
|
|
|
{ |
416
|
3 |
|
return $this->showPercent; |
417
|
|
|
} |
418
|
|
|
|
419
|
|
|
/** |
420
|
|
|
* Set show percentage |
421
|
|
|
* Specifies that the percentage should be shown in data labels. |
422
|
|
|
* |
423
|
|
|
* @param bool $value Show percentage |
424
|
|
|
* |
425
|
|
|
* @return Layout |
426
|
|
|
*/ |
427
|
3 |
|
public function setShowPercent($value) |
428
|
|
|
{ |
429
|
3 |
|
$this->showPercent = $value; |
430
|
|
|
|
431
|
3 |
|
return $this; |
432
|
|
|
} |
433
|
|
|
|
434
|
|
|
/** |
435
|
|
|
* Get show bubble size. |
436
|
|
|
* |
437
|
|
|
* @return bool |
438
|
|
|
*/ |
439
|
3 |
|
public function getShowBubbleSize() |
440
|
|
|
{ |
441
|
3 |
|
return $this->showBubbleSize; |
442
|
|
|
} |
443
|
|
|
|
444
|
|
|
/** |
445
|
|
|
* Set show bubble size |
446
|
|
|
* Specifies that the bubble size should be shown in data labels. |
447
|
|
|
* |
448
|
|
|
* @param bool $value Show bubble size |
449
|
|
|
* |
450
|
|
|
* @return Layout |
451
|
|
|
*/ |
452
|
2 |
|
public function setShowBubbleSize($value) |
453
|
|
|
{ |
454
|
2 |
|
$this->showBubbleSize = $value; |
455
|
|
|
|
456
|
2 |
|
return $this; |
457
|
|
|
} |
458
|
|
|
|
459
|
|
|
/** |
460
|
|
|
* Get show leader lines. |
461
|
|
|
* |
462
|
|
|
* @return bool |
463
|
|
|
*/ |
464
|
3 |
|
public function getShowLeaderLines() |
465
|
|
|
{ |
466
|
3 |
|
return $this->showLeaderLines; |
467
|
|
|
} |
468
|
|
|
|
469
|
|
|
/** |
470
|
|
|
* Set show leader lines |
471
|
|
|
* Specifies that leader lines should be shown in data labels. |
472
|
|
|
* |
473
|
|
|
* @param bool $value Show leader lines |
474
|
|
|
* |
475
|
|
|
* @return Layout |
476
|
|
|
*/ |
477
|
2 |
|
public function setShowLeaderLines($value) |
478
|
|
|
{ |
479
|
2 |
|
$this->showLeaderLines = $value; |
480
|
|
|
|
481
|
2 |
|
return $this; |
482
|
|
|
} |
483
|
|
|
} |
484
|
|
|
|