GaugeChartOptions::setYellowTo()   A
last analyzed

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
c 0
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\GaugeChart;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Animation;
6
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ChartOptions;
7
use CMEN\GoogleChartsBundle\GoogleCharts\Options\MaxTrait;
8
use CMEN\GoogleChartsBundle\GoogleCharts\Options\MinTrait;
9
10
/**
11
 * @author Christophe Meneses
12
 */
13
class GaugeChartOptions extends ChartOptions
14
{
15
    use MaxTrait;
16
17
    use MinTrait;
18
19
    /**
20
     * @var Animation
21
     */
22
    protected $animation;
23
24
    /**
25
     * The color to use for the green section, in HTML color notation.
26
     *
27
     * @var string
28
     */
29
    protected $greenColor;
30
31
    /**
32
     * The lowest value for a range marked by a green color.
33
     *
34
     * @var int
35
     */
36
    protected $greenFrom;
37
38
    /**
39
     * The highest value for a range marked by a green color.
40
     *
41
     * @var int
42
     */
43
    protected $greenTo;
44
45
    /**
46
     * Labels for major tick marks. The number of labels define the number of major ticks in all gauges. The default
47
     * is five major ticks, with the labels of the minimal and maximal gauge value.
48
     *
49
     * @var array<mixed>
50
     */
51
    protected $majorTicks;
52
53
    /**
54
     * The number of minor tick section in each major tick section.
55
     *
56
     * @var int
57
     */
58
    protected $minorTicks;
59
60
    /**
61
     * The color to use for the red section, in HTML color notation.
62
     *
63
     * @var string
64
     */
65
    protected $redColor;
66
67
    /**
68
     * The lowest value for a range marked by a red color.
69
     *
70
     * @var int
71
     */
72
    protected $redFrom;
73
74
    /**
75
     * The highest value for a range marked by a red color.
76
     *
77
     * @var int
78
     */
79
    protected $redTo;
80
81
    /**
82
     * The color to use for the yellow section, in HTML color notation.
83
     *
84
     * @var string
85
     */
86
    protected $yellowColor;
87
88
    /**
89
     * The lowest value for a range marked by a yellow color.
90
     *
91
     * @var int
92
     */
93
    protected $yellowFrom;
94
95
    /**
96
     * The highest value for a range marked by a yellow color.
97
     *
98
     * @var int
99
     */
100
    protected $yellowTo;
101
102
    public function __construct()
103
    {
104
        parent::__construct();
105
106
        $this->animation = new Animation();
107
    }
108
109
    public function getAnimation(): Animation
110
    {
111
        return $this->animation;
112
    }
113
114
    /**
115
     * @return $this
116
     */
117
    public function setGreenColor(string $greenColor)
118
    {
119
        $this->greenColor = $greenColor;
120
121
        return $this;
122
    }
123
124
    /**
125
     * @return $this
126
     */
127
    public function setGreenFrom(int $greenFrom)
128
    {
129
        $this->greenFrom = $greenFrom;
130
131
        return $this;
132
    }
133
134
    /**
135
     * @return $this
136
     */
137
    public function setGreenTo(int $greenTo)
138
    {
139
        $this->greenTo = $greenTo;
140
141
        return $this;
142
    }
143
144
    /**
145
     * @param array<mixed> $majorTicks
146
     *
147
     * @return $this
148
     */
149
    public function setMajorTicks(array $majorTicks)
150
    {
151
        $this->majorTicks = $majorTicks;
152
153
        return $this;
154
    }
155
156
    /**
157
     * @return $this
158
     */
159
    public function setMinorTicks(int $minorTicks)
160
    {
161
        $this->minorTicks = $minorTicks;
162
163
        return $this;
164
    }
165
166
    /**
167
     * @return $this
168
     */
169
    public function setRedColor(string $redColor)
170
    {
171
        $this->redColor = $redColor;
172
173
        return $this;
174
    }
175
176
    /**
177
     * @return $this
178
     */
179
    public function setRedFrom(int $redFrom)
180
    {
181
        $this->redFrom = $redFrom;
182
183
        return $this;
184
    }
185
186
    /**
187
     * @return $this
188
     */
189
    public function setRedTo(int $redTo)
190
    {
191
        $this->redTo = $redTo;
192
193
        return $this;
194
    }
195
196
    /**
197
     * @return $this
198
     */
199
    public function setYellowColor(string $yellowColor)
200
    {
201
        $this->yellowColor = $yellowColor;
202
203
        return $this;
204
    }
205
206
    /**
207
     * @return $this
208
     */
209
    public function setYellowFrom(int $yellowFrom)
210
    {
211
        $this->yellowFrom = $yellowFrom;
212
213
        return $this;
214
    }
215
216
    /**
217
     * @return $this
218
     */
219
    public function setYellowTo(int $yellowTo)
220
    {
221
        $this->yellowTo = $yellowTo;
222
223
        return $this;
224
    }
225
}
226