1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\ColumnChart; |
4
|
|
|
|
5
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnimation; |
6
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnnotations; |
7
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedChartOptions; |
8
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedHAxis; |
9
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedTooltip; |
10
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Bar; |
11
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\DataOpacityTrait; |
12
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Explorer; |
13
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\FocusTargetTrait; |
14
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\IsStackedTrait; |
15
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Legend; |
16
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\OrientationTrait; |
17
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ReverseCategoriesTrait; |
18
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Trendlines; |
19
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\VAxesTrait; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @author Christophe Meneses |
23
|
|
|
*/ |
24
|
|
View Code Duplication |
class ColumnChartOptions extends AdvancedChartOptions |
|
|
|
|
25
|
|
|
{ |
26
|
|
|
/** |
27
|
|
|
* @var AdvancedAnimation |
28
|
|
|
*/ |
29
|
|
|
protected $animation; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @var AdvancedAnnotations |
33
|
|
|
*/ |
34
|
|
|
protected $annotations; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @var Bar |
38
|
|
|
*/ |
39
|
|
|
protected $bar; |
40
|
|
|
|
41
|
|
|
use DataOpacityTrait; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @var Explorer |
45
|
|
|
*/ |
46
|
|
|
protected $explorer; |
47
|
|
|
|
48
|
|
|
use FocusTargetTrait; |
49
|
|
|
|
50
|
|
|
/** |
51
|
|
|
* @var AdvancedHAxis |
52
|
|
|
*/ |
53
|
|
|
protected $hAxis; |
54
|
|
|
|
55
|
|
|
use IsStackedTrait; |
56
|
|
|
|
57
|
|
|
/** |
58
|
|
|
* @var Legend |
59
|
|
|
*/ |
60
|
|
|
protected $legend; |
61
|
|
|
|
62
|
|
|
use OrientationTrait; |
63
|
|
|
|
64
|
|
|
use ReverseCategoriesTrait; |
65
|
|
|
|
66
|
|
|
/** |
67
|
|
|
* @var AdvancedTooltip |
68
|
|
|
*/ |
69
|
|
|
protected $tooltip; |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Displays trendlines on the charts that support them. By default, linear trendlines are used, but this can be |
73
|
|
|
* customized with the trendlines.n.type option. |
74
|
|
|
* |
75
|
|
|
* @var Trendlines[] |
76
|
|
|
*/ |
77
|
|
|
protected $trendlines; |
78
|
|
|
|
79
|
|
|
use VAxesTrait; |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* ColumnChartOptions constructor. |
83
|
|
|
*/ |
84
|
|
|
public function __construct() |
85
|
|
|
{ |
86
|
|
|
parent::__construct(); |
87
|
|
|
|
88
|
|
|
$this->animation = new AdvancedAnimation(); |
89
|
|
|
$this->annotations = new AdvancedAnnotations(); |
90
|
|
|
$this->bar = new Bar(); |
91
|
|
|
$this->explorer = new Explorer(); |
92
|
|
|
$this->hAxis = new AdvancedHAxis(); |
93
|
|
|
$this->legend = new Legend(); |
94
|
|
|
$this->tooltip = new AdvancedTooltip(); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @return AdvancedAnimation |
99
|
|
|
*/ |
100
|
|
|
public function getAnimation() |
101
|
|
|
{ |
102
|
|
|
return $this->animation; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @return AdvancedAnnotations |
107
|
|
|
*/ |
108
|
|
|
public function getAnnotations() |
109
|
|
|
{ |
110
|
|
|
return $this->annotations; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @return Bar |
115
|
|
|
*/ |
116
|
|
|
public function getBar() |
117
|
|
|
{ |
118
|
|
|
return $this->bar; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @return Explorer |
123
|
|
|
*/ |
124
|
|
|
public function getExplorer() |
125
|
|
|
{ |
126
|
|
|
return $this->explorer; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @return AdvancedHAxis |
131
|
|
|
*/ |
132
|
|
|
public function getHAxis() |
133
|
|
|
{ |
134
|
|
|
return $this->hAxis; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @return Legend |
139
|
|
|
*/ |
140
|
|
|
public function getLegend() |
141
|
|
|
{ |
142
|
|
|
return $this->legend; |
143
|
|
|
} |
144
|
3 |
|
|
145
|
|
|
/** |
146
|
3 |
|
* @return AdvancedTooltip |
147
|
|
|
*/ |
148
|
3 |
|
public function getTooltip() |
149
|
3 |
|
{ |
150
|
3 |
|
return $this->tooltip; |
151
|
3 |
|
} |
152
|
3 |
|
|
153
|
3 |
|
/** |
154
|
3 |
|
* @param Trendlines[] $trendlines |
155
|
3 |
|
* |
156
|
|
|
* @return $this |
157
|
|
|
*/ |
158
|
|
|
public function setTrendlines($trendlines) |
159
|
|
|
{ |
160
|
|
|
$this->trendlines = $trendlines; |
161
|
1 |
|
|
162
|
|
|
return $this; |
163
|
1 |
|
} |
164
|
|
|
} |
165
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.