AdvancedHAxis::setMinTextSpacing()   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 AdvancedHAxis extends MediumHAxis
6
{
7
    /**
8
     * If false, will hide outermost labels rather than allow them to be cropped by the chart container. If true,
9
     * will allow label cropping.
10
     *
11
     * @var bool
12
     */
13
    protected $allowContainerBoundaryTextCufoff;
14
15
    /**
16
     * If true, draw the horizontal axis text at an angle, to help fit more text along the axis; if false, draw
17
     * horizontal axis text upright. Default behavior is to slant text if it cannot all fit when drawn upright.
18
     * Notice that this option is available only when the hAxis.textPosition is set to 'out' (which is the default).
19
     *
20
     * @var bool
21
     */
22
    protected $slantedText;
23
24
    /**
25
     * The angle of the horizontal axis text, if it's drawn slanted. Ignored if hAxis.slantedText is false, or is in
26
     * auto mode, and the chart decided to draw the text horizontally.
27
     *
28
     * @var int
29
     */
30
    protected $slantedTextAngle;
31
32
    /**
33
     * Maximum number of levels of horizontal axis text. If axis text labels become too crowded, the server might
34
     * shift neighboring labels up or down in order to fit labels closer together. This value specifies the most
35
     * number of levels to use; the server can use fewer levels, if labels can fit without overlapping.
36
     *
37
     * @var int
38
     */
39
    protected $maxAlternation;
40
41
    /**
42
     * Maximum number of lines allowed for the text labels. Labels can span multiple lines if they are too long,
43
     * and the nuber of lines is, by default, limited by the height of the available space.
44
     *
45
     * @var int
46
     */
47
    protected $maxTextLines;
48
49
    /**
50
     * Minimum horizontal spacing, in pixels, allowed between two adjacent text labels. If the labels are spaced too
51
     * densely, or they are too long, the spacing can drop below this threshold, and in this case one of the
52
     * label-unclutter measures will be applied (e.g, truncating the lables or dropping some of them).
53
     *
54
     * @var int
55
     */
56
    protected $minTextSpacing;
57
58
    /**
59
     * How many horizontal axis labels to show, where 1 means show every label, 2 means show every other label,
60
     * and so on. Default is to try to show as many labels as possible without overlapping.
61
     *
62
     * @var int
63
     */
64
    protected $showTextEvery;
65
66
    /**
67
     * @return $this
68
     */
69 2
    public function setShowTextEvery(int $showTextEvery)
70
    {
71 2
        $this->showTextEvery = $showTextEvery;
72
73 2
        return $this;
74
    }
75
76
    /**
77
     * @return $this
78
     */
79 2
    public function setAllowContainerBoundaryTextCufoff(bool $allowContainerBoundaryTextCufoff)
80
    {
81 2
        $this->allowContainerBoundaryTextCufoff = $allowContainerBoundaryTextCufoff;
82
83 2
        return $this;
84
    }
85
86
    /**
87
     * @return $this
88
     */
89 2
    public function setSlantedText(bool $slantedText)
90
    {
91 2
        $this->slantedText = $slantedText;
92
93 2
        return $this;
94
    }
95
96
    /**
97
     * @return $this
98
     */
99 2
    public function setSlantedTextAngle(int $slantedTextAngle)
100
    {
101 2
        $this->slantedTextAngle = $slantedTextAngle;
102
103 2
        return $this;
104
    }
105
106
    /**
107
     * @return $this
108
     */
109 2
    public function setMaxAlternation(int $maxAlternation)
110
    {
111 2
        $this->maxAlternation = $maxAlternation;
112
113 2
        return $this;
114
    }
115
116
    /**
117
     * @return $this
118
     */
119 2
    public function setMaxTextLines(int $maxTextLines)
120
    {
121 2
        $this->maxTextLines = $maxTextLines;
122
123 2
        return $this;
124
    }
125
126
    /**
127
     * @return $this
128
     */
129 2
    public function setMinTextSpacing(int $minTextSpacing)
130
    {
131 2
        $this->minTextSpacing = $minTextSpacing;
132
133 2
        return $this;
134
    }
135
}
136