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