Passed
Push — master ( 9b5a70...c1cb1a )
by Christophe
09:50 queued 07:13
created

ComboChartOptions::setSeriesType()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\ComboChart;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnimation;
6
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedHAxis;
7
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedLegend;
8
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Annotations;
9
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AreaOpacityTrait;
10
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Bar;
11
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Candlestick;
12
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Crosshair;
13
use CMEN\GoogleChartsBundle\GoogleCharts\Options\CurveTypeTrait;
14
use CMEN\GoogleChartsBundle\GoogleCharts\Options\DataOpacityTrait;
15
use CMEN\GoogleChartsBundle\GoogleCharts\Options\FocusTargetTrait;
16
use CMEN\GoogleChartsBundle\GoogleCharts\Options\InterpolateNullsTrait;
17
use CMEN\GoogleChartsBundle\GoogleCharts\Options\IsStackedTrait;
18
use CMEN\GoogleChartsBundle\GoogleCharts\Options\LineOptions;
19
use CMEN\GoogleChartsBundle\GoogleCharts\Options\OrientationTrait;
20
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ReverseCategoriesTrait;
21
use CMEN\GoogleChartsBundle\GoogleCharts\Options\SelectionModeTrait;
22
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Trendlines;
23
use CMEN\GoogleChartsBundle\GoogleCharts\Options\VAxesTrait;
24
25
/**
26
 * @author Christophe Meneses
27
 */
28
class ComboChartOptions extends LineOptions
29
{
30
    use AreaOpacityTrait;
31
32
    use CurveTypeTrait;
33
34
    use DataOpacityTrait;
35
36
    use FocusTargetTrait;
37
38
    use InterpolateNullsTrait;
39
40
    use IsStackedTrait;
41
42
    use OrientationTrait;
43
44
    use ReverseCategoriesTrait;
45
46
    use SelectionModeTrait;
47
48
    use VAxesTrait;
49
50
    /**
51
     * @var AdvancedAnimation
52
     */
53
    protected $animation;
54
55
    /**
56
     * @var Annotations
57
     */
58
    protected $annotations;
59
60
    /**
61
     * @var Bar
62
     */
63
    protected $bar;
64
65
    /**
66
     * @var Candlestick
67
     */
68
    protected $candlestick;
69
70
    /**
71
     * @var Crosshair
72
     */
73
    protected $crosshair;
74
75
    /**
76
     * @var AdvancedHAxis
77
     */
78
    protected $hAxis;
79
80
    /**
81
     * @var AdvancedLegend
82
     */
83
    protected $legend;
84
85
    /**
86
     * The default line type for any series not specified in the series property. Available values are 'line', 'area',
87
     * 'bars', 'candlesticks', and 'steppedArea'.
88
     *
89
     * @var string
90
     */
91
    protected $seriesType;
92
93
    /**
94
     * Displays trendlines on the charts that support them. By default, linear trendlines are used, but this can be
95
     * customized with the trendlines.n.type option.
96
     *
97
     * @var Trendlines[]
98
     */
99
    protected $trendlines;
100
101 1
    public function __construct()
102
    {
103 1
        parent::__construct();
104
105 1
        $this->animation = new AdvancedAnimation();
106 1
        $this->annotations = new Annotations();
107 1
        $this->bar = new Bar();
108 1
        $this->candlestick = new Candlestick();
109 1
        $this->crosshair = new Crosshair();
110 1
        $this->hAxis = new AdvancedHAxis();
111 1
        $this->legend = new AdvancedLegend();
112
    }
113
114
    public function getAnimation(): AdvancedAnimation
115
    {
116
        return $this->animation;
117
    }
118
119
    public function getAnnotations(): Annotations
120
    {
121
        return $this->annotations;
122
    }
123
124
    public function getBar(): Bar
125
    {
126
        return $this->bar;
127
    }
128
129
    public function getCandlestick(): Candlestick
130
    {
131
        return $this->candlestick;
132
    }
133
134
    public function getCrosshair(): Crosshair
135
    {
136
        return $this->crosshair;
137
    }
138
139
    public function getHAxis(): AdvancedHAxis
140
    {
141
        return $this->hAxis;
142
    }
143
144
    public function getLegend(): AdvancedLegend
145
    {
146
        return $this->legend;
147
    }
148
149
    /**
150
     * @param Trendlines[] $trendlines
151
     *
152
     * @return $this
153
     */
154
    public function setTrendlines(array $trendlines)
155
    {
156
        $this->trendlines = $trendlines;
157
158
        return $this;
159
    }
160
161
    /**
162
     * @return $this
163
     */
164
    public function setSeriesType(string $seriesType)
165
    {
166
        $this->seriesType = $seriesType;
167
168
        return $this;
169
    }
170
}
171