BarChartOptions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 8
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 11
ccs 0
cts 9
cp 0
crap 2
rs 10
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\BarChart;
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\AdvancedLegend;
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\HAxis;
15
use CMEN\GoogleChartsBundle\GoogleCharts\Options\IsStackedTrait;
16
use CMEN\GoogleChartsBundle\GoogleCharts\Options\MediumHAxis;
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
    use DataOpacityTrait;
27
28
    use FocusTargetTrait;
29
30
    use IsStackedTrait;
31
32
    use OrientationTrait;
33
34
    use ReverseCategoriesTrait;
35
36
    /**
37
     * @var AdvancedAnimation
38
     */
39
    protected $animation;
40
41
    /**
42
     * @var AdvancedAnnotations
43
     */
44
    protected $annotations;
45
46
    /**
47
     * @var Bar
48
     */
49
    protected $bar;
50
51
    /**
52
     * @var Explorer
53
     */
54
    protected $explorer;
55
56
    /**
57
     * Specifies properties for individual horizontal axes, if the chart has multiple horizontal axes. Each child
58
     * object is a hAxis object, and can contain all the properties supported by hAxis. These property values
59
     * override any global settings for the same property.
60
     *
61
     * To specify a chart with multiple horizontal axes, first define a new axis using series.targetAxisIndex, then
62
     * configure the axis using hAxes.
63
     *
64
     * @var HAxis[]
65
     */
66
    protected $hAxes;
67
68
    /**
69
     * @var MediumHAxis
70
     */
71
    protected $hAxis;
72
73
    /**
74
     * @var AdvancedLegend
75
     */
76
    protected $legend;
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
    public function __construct()
92
    {
93
        parent::__construct();
94
95
        $this->animation = new AdvancedAnimation();
96
        $this->annotations = new AdvancedAnnotations();
97
        $this->bar = new Bar();
98
        $this->explorer = new Explorer();
99
        $this->hAxis = new MediumHAxis();
100
        $this->legend = new AdvancedLegend();
101
        $this->tooltip = new AdvancedTooltip();
102
    }
103
104
    public function getAnimation(): AdvancedAnimation
105
    {
106
        return $this->animation;
107
    }
108
109
    public function getAnnotations(): AdvancedAnnotations
110
    {
111
        return $this->annotations;
112
    }
113
114
    public function getBar(): Bar
115
    {
116
        return $this->bar;
117
    }
118
119
    public function getExplorer(): Explorer
120
    {
121
        return $this->explorer;
122
    }
123
124
    public function getHAxis(): MediumHAxis
125
    {
126
        return $this->hAxis;
127
    }
128
129
    public function getLegend(): AdvancedLegend
130
    {
131
        return $this->legend;
132
    }
133
134
    public function getTooltip(): AdvancedTooltip
135
    {
136
        return $this->tooltip;
137
    }
138
139
    /**
140
     * @param HAxis[] $hAxes
141
     *
142
     * @return $this
143
     */
144
    public function setHAxes(array $hAxes)
145
    {
146
        $this->hAxes = $hAxes;
147
148
        return $this;
149
    }
150
151
    /**
152
     * @param Trendlines[] $trendlines
153
     *
154
     * @return $this
155
     */
156
    public function setTrendlines(array $trendlines)
157
    {
158
        $this->trendlines = $trendlines;
159
160
        return $this;
161
    }
162
}
163