|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\Timeline; |
|
4
|
|
|
|
|
5
|
|
|
/** |
|
6
|
|
|
* @author Christophe Meneses |
|
7
|
|
|
*/ |
|
8
|
|
|
class Timeline |
|
9
|
|
|
{ |
|
10
|
|
|
/** |
|
11
|
|
|
* @var BarLabelStyle |
|
12
|
|
|
*/ |
|
13
|
|
|
protected $barLabelStyle; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* If set to true, colors every bar on the row the same. The default is to use one color per bar label. |
|
17
|
|
|
* |
|
18
|
|
|
* @var bool |
|
19
|
|
|
*/ |
|
20
|
|
|
protected $colorByRowLabel; |
|
21
|
|
|
|
|
22
|
|
|
/** |
|
23
|
|
|
* If set to false, creates one row for every dataTable entry. The default is to collect bars with the same row |
|
24
|
|
|
* label into one row. |
|
25
|
|
|
* |
|
26
|
|
|
* @var bool |
|
27
|
|
|
*/ |
|
28
|
|
|
protected $groupByRowLabel; |
|
29
|
|
|
|
|
30
|
|
|
/** |
|
31
|
|
|
* @var RowLabelStyle |
|
32
|
|
|
*/ |
|
33
|
|
|
protected $rowLabelStyle; |
|
34
|
|
|
|
|
35
|
|
|
/** |
|
36
|
|
|
* If set to false, omits bar labels. The default is to show them. |
|
37
|
|
|
* |
|
38
|
|
|
* @var bool |
|
39
|
|
|
*/ |
|
40
|
|
|
protected $showBarLabels; |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* If set to false, omits row labels. The default is to show them. |
|
44
|
|
|
* |
|
45
|
|
|
* @var bool |
|
46
|
|
|
*/ |
|
47
|
|
|
protected $showRowLabels; |
|
48
|
|
|
|
|
49
|
|
|
/** |
|
50
|
|
|
* Colors all bars the same. Specified as a hex value (e.g., '#8d8'). |
|
51
|
|
|
* |
|
52
|
|
|
* @var string |
|
53
|
|
|
*/ |
|
54
|
|
|
protected $singleColor; |
|
55
|
|
|
|
|
56
|
|
|
public function __construct() |
|
57
|
|
|
{ |
|
58
|
|
|
$this->barLabelStyle = new BarLabelStyle(); |
|
59
|
|
|
$this->rowLabelStyle = new RowLabelStyle(); |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function getBarLabelStyle(): BarLabelStyle |
|
63
|
|
|
{ |
|
64
|
|
|
return $this->barLabelStyle; |
|
65
|
|
|
} |
|
66
|
|
|
|
|
67
|
|
|
public function getRowLabelStyle(): RowLabelStyle |
|
68
|
|
|
{ |
|
69
|
|
|
return $this->rowLabelStyle; |
|
70
|
|
|
} |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @return $this |
|
74
|
|
|
*/ |
|
75
|
|
|
public function setColorByRowLabel(bool $colorByRowLabel) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->colorByRowLabel = $colorByRowLabel; |
|
78
|
|
|
|
|
79
|
|
|
return $this; |
|
80
|
|
|
} |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @return $this |
|
84
|
|
|
*/ |
|
85
|
|
|
public function setShowBarLabels(bool $showBarLabels) |
|
86
|
|
|
{ |
|
87
|
|
|
$this->showBarLabels = $showBarLabels; |
|
88
|
|
|
|
|
89
|
|
|
return $this; |
|
90
|
|
|
} |
|
91
|
|
|
|
|
92
|
|
|
/** |
|
93
|
|
|
* @return $this |
|
94
|
|
|
*/ |
|
95
|
|
|
public function setShowRowLabels(bool $showRowLabels) |
|
96
|
|
|
{ |
|
97
|
|
|
$this->showRowLabels = $showRowLabels; |
|
98
|
|
|
|
|
99
|
|
|
return $this; |
|
100
|
|
|
} |
|
101
|
|
|
|
|
102
|
|
|
/** |
|
103
|
|
|
* @return $this |
|
104
|
|
|
*/ |
|
105
|
|
|
public function setSingleColor(string $singleColor) |
|
106
|
|
|
{ |
|
107
|
|
|
$this->singleColor = $singleColor; |
|
108
|
|
|
|
|
109
|
|
|
return $this; |
|
110
|
|
|
} |
|
111
|
|
|
|
|
112
|
|
|
/** |
|
113
|
|
|
* @return $this |
|
114
|
|
|
*/ |
|
115
|
|
|
public function setGroupByRowLabel(bool $groupByRowLabel) |
|
116
|
|
|
{ |
|
117
|
|
|
$this->groupByRowLabel = $groupByRowLabel; |
|
118
|
|
|
|
|
119
|
|
|
return $this; |
|
120
|
|
|
} |
|
121
|
|
|
} |
|
122
|
|
|
|