MediumHAxis::setFormat()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
class MediumHAxis extends HAxis
6
{
7
    /**
8
     * The baseline for the horizontal axis.
9
     * This option is only supported for a continuous axis.
10
     *
11
     * @var int
12
     */
13
    protected $baseline;
14
15
    /**
16
     * The color of the baseline for the horizontal axis. Can be any HTML color string, for example: 'red' or '#00cc00'.
17
     * This option is only supported for a continuous axis.
18
     *
19
     * @var string
20
     */
21
    protected $baselineColor;
22
23
    /**
24
     * The direction in which the values along the horizontal axis grow. Specify -1 to reverse the order of the values
25
     * or 1 for normal order.
26
     *
27
     * @var int
28
     */
29
    protected $direction;
30
31
    /**
32
     * A format string for numeric or date axis labels.
33
     * For number axis labels, this is a subset of the decimal formatting ICU pattern set . For instance,
34
     * '#,###%' will display values "1,000%", "750%", and "50%" for values 10, 7.5, and 0.5. You can also
35
     * supply any of the following :
36
     *     'none' : displays numbers with no formatting (e.g., 8000000)
37
     *     'decimal' : displays numbers with thousands separators (e.g., 8,000,000)
38
     *     'scientific' : displays numbers in scientific notation (e.g., 8e6)
39
     *     'currency' : displays numbers in the local currency (e.g., $8,000,000.00)
40
     *     'percent' : displays numbers as percentages (e.g., 800,000,000%)
41
     *     'short' : displays abbreviated numbers (e.g., 8M)
42
     *     'long' : displays numbers as full words (e.g., 8 million).
43
     *
44
     * For date axis labels, this is a subset of the date formatting ICU pattern set . For instance, 'MMM d, y' will
45
     * display the value "Jul 1, 2011" for the date of July first in 2011.
46
     * The actual formatting applied to the label is derived from the locale the API has been loaded with. For more
47
     * details, see loading charts with a specific locale .
48
     * This option is only supported for a continuous axis.
49
     *
50
     * @var string
51
     */
52
    protected $format;
53
54
    /**
55
     * hAxis property that makes the horizontal axis a logarithmic scale (requires all values to be positive).
56
     * Set to true for yes.
57
     * This option is only supported for a continuous axis.
58
     *
59
     * @var bool
60
     */
61
    protected $logScale;
62
63
    /**
64
     *  hAxis property that makes the horizontal axis a logarithmic scale. Can be one of the following:.
65
     *
66
     * - null : No logarithmic scaling is performed.
67
     * - 'log' : Logarithmic scaling. Negative and zero values are not plotted. This option is the same as setting
68
     *     hAxis: { logscale: true }.
69
     * - 'mirrorLog' : Logarithmic scaling in which negative and zero values are plotted. The plotted value of a
70
     *     negative number is the negative of the log of the absolute value. Values close to 0 are plotted on a
71
     *     linear scale.
72
     *
73
     * This option is only supported for a continuous axis.
74
     *
75
     * @var string
76
     */
77
    protected $scaleType;
78
79
    /**
80
     * Moves the max value of the horizontal axis to the specified value; this will be rightward in most charts.
81
     * Ignored if this is set to a value smaller than the maximum x-value of the data. hAxis.viewWindow.max overrides
82
     * this property.
83
     * This option is only supported for a continuous axis.
84
     *
85
     * @var int
86
     */
87
    protected $maxValue;
88
89
    /**
90
     * Moves the min value of the horizontal axis to the specified value; this will be leftward in most charts.
91
     * Ignored if this is set to a value greater than the minimum x-value of the data. hAxis.viewWindow.min overrides
92
     * this property.
93
     * This option is only supported for a continuous axis.
94
     *
95
     * @var int
96
     */
97
    protected $minValue;
98
99
    /**
100
     * Replaces the automatically generated X-axis ticks with the specified array. Each element of the array should be
101
     * either a valid tick value (such as a number, date, datetime, or timeofday), or an array. If it's an array, it
102
     * should have a v property for the tick value, and an optional f property containing the literal string to be
103
     * displayed as the label. Examples :
104
     * [5, 10, 15, 20]
105
     * [['v' => 32, 'f' => 'thirty two'], ['v' => 64, 'f' => 'sixty four']].
106
     *
107
     * This option is only supported for a continuous axis.
108
     *
109
     * @var array<mixed>
110
     */
111
    protected $ticks;
112
113
    /**
114
     * @return $this
115
     */
116 2
    public function setBaseline(int $baseline)
117
    {
118 2
        $this->baseline = $baseline;
119
120 2
        return $this;
121
    }
122
123
    /**
124
     * @return $this
125
     */
126 2
    public function setBaselineColor(string $baselineColor)
127
    {
128 2
        $this->baselineColor = $baselineColor;
129
130 2
        return $this;
131
    }
132
133
    /**
134
     * @return $this
135
     */
136 2
    public function setDirection(int $direction)
137
    {
138 2
        $this->direction = $direction;
139
140 2
        return $this;
141
    }
142
143
    /**
144
     * @return $this
145
     */
146 2
    public function setFormat(string $format)
147
    {
148 2
        $this->format = $format;
149
150 2
        return $this;
151
    }
152
153
    /**
154
     * @return $this
155
     */
156 2
    public function setLogScale(bool $logScale)
157
    {
158 2
        $this->logScale = $logScale;
159
160 2
        return $this;
161
    }
162
163
    /**
164
     * @return $this
165
     */
166 2
    public function setScaleType(string $scaleType)
167
    {
168 2
        $this->scaleType = $scaleType;
169
170 2
        return $this;
171
    }
172
173
    /**
174
     * @param array<mixed> $ticks
175
     *
176
     * @return $this
177
     */
178 2
    public function setTicks(array $ticks)
179
    {
180 2
        $this->ticks = $ticks;
181
182 2
        return $this;
183
    }
184
185
    /**
186
     * @return $this
187
     */
188 2
    public function setMaxValue(int $maxValue)
189
    {
190 2
        $this->maxValue = $maxValue;
191
192 2
        return $this;
193
    }
194
195
    /**
196
     * @return $this
197
     */
198 2
    public function setMinValue(int $minValue)
199
    {
200 2
        $this->minValue = $minValue;
201
202 2
        return $this;
203
    }
204
}
205