1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\BarChart; |
4
|
|
|
|
5
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnimation; |
6
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedChartOptions; |
7
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedTooltip; |
8
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Bar; |
9
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\DataOpacityTrait; |
10
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Explorer; |
11
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedLegend; |
12
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\FocusTargetTrait; |
13
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\HAxis; |
14
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\IsStackedTrait; |
15
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\MediumHAxis; |
16
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnnotations; |
17
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\OrientationTrait; |
18
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ReverseCategoriesTrait; |
19
|
|
|
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Trendlines; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @author Christophe Meneses |
23
|
|
|
*/ |
24
|
|
|
class BarChartOptions 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
|
|
|
* Specifies properties for individual horizontal axes, if the chart has multiple horizontal axes. Each child |
52
|
|
|
* object is a hAxis object, and can contain all the properties supported by hAxis. These property values |
53
|
|
|
* override any global settings for the same property. |
54
|
|
|
* |
55
|
|
|
* To specify a chart with multiple horizontal axes, first define a new axis using series.targetAxisIndex, then |
56
|
|
|
* configure the axis using hAxes. |
57
|
|
|
* |
58
|
|
|
* @var HAxis[] |
59
|
|
|
*/ |
60
|
|
|
protected $hAxes; |
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @var MediumHAxis |
64
|
|
|
*/ |
65
|
|
|
protected $hAxis; |
66
|
|
|
|
67
|
|
|
use IsStackedTrait; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var AdvancedLegend |
71
|
|
|
*/ |
72
|
|
|
protected $legend; |
73
|
|
|
|
74
|
|
|
use OrientationTrait; |
75
|
|
|
|
76
|
|
|
use ReverseCategoriesTrait; |
77
|
|
|
|
78
|
|
|
/** |
79
|
|
|
* @var AdvancedTooltip |
80
|
|
|
*/ |
81
|
|
|
protected $tooltip; |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Displays trendlines on the charts that support them. By default, linear trendlines are used, but this can be |
85
|
|
|
* customized with the trendlines.n.type option. |
86
|
|
|
* |
87
|
|
|
* @var Trendlines[] |
88
|
|
|
*/ |
89
|
|
|
protected $trendlines; |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* BarChartOptions constructor. |
93
|
|
|
*/ |
94
|
|
|
public function __construct() |
95
|
|
|
{ |
96
|
|
|
parent::__construct(); |
97
|
|
|
|
98
|
|
|
$this->animation = new AdvancedAnimation(); |
99
|
|
|
$this->annotations = new AdvancedAnnotations(); |
100
|
|
|
$this->bar = new Bar(); |
101
|
|
|
$this->explorer = new Explorer(); |
102
|
|
|
$this->hAxis = new MediumHAxis(); |
103
|
|
|
$this->legend = new AdvancedLegend(); |
104
|
|
|
$this->tooltip = new AdvancedTooltip(); |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return AdvancedAnimation |
109
|
|
|
*/ |
110
|
|
|
public function getAnimation() |
111
|
|
|
{ |
112
|
|
|
return $this->animation; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @return AdvancedAnnotations |
117
|
|
|
*/ |
118
|
|
|
public function getAnnotations() |
119
|
|
|
{ |
120
|
|
|
return $this->annotations; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @return Bar |
125
|
|
|
*/ |
126
|
|
|
public function getBar() |
127
|
|
|
{ |
128
|
|
|
return $this->bar; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @return Explorer |
133
|
|
|
*/ |
134
|
|
|
public function getExplorer() |
135
|
|
|
{ |
136
|
|
|
return $this->explorer; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @return MediumHAxis |
141
|
|
|
*/ |
142
|
|
|
public function getHAxis() |
143
|
|
|
{ |
144
|
|
|
return $this->hAxis; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @return AdvancedLegend |
149
|
|
|
*/ |
150
|
|
|
public function getLegend() |
151
|
|
|
{ |
152
|
|
|
return $this->legend; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @return AdvancedTooltip |
157
|
|
|
*/ |
158
|
|
|
public function getTooltip() |
159
|
|
|
{ |
160
|
|
|
return $this->tooltip; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @param HAxis[] $hAxes |
165
|
|
|
* |
166
|
|
|
* @return $this |
167
|
|
|
*/ |
168
|
|
|
public function setHAxes($hAxes) |
169
|
|
|
{ |
170
|
|
|
$this->hAxes = $hAxes; |
171
|
|
|
|
172
|
|
|
return $this; |
173
|
|
|
} |
174
|
|
|
|
175
|
|
|
/** |
176
|
|
|
* @param Trendlines[] $trendlines |
177
|
|
|
* |
178
|
|
|
* @return $this |
179
|
|
|
*/ |
180
|
|
|
public function setTrendlines($trendlines) |
181
|
|
|
{ |
182
|
|
|
$this->trendlines = $trendlines; |
183
|
|
|
|
184
|
|
|
return $this; |
185
|
|
|
} |
186
|
|
|
} |
187
|
|
|
|