HAxis   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 104
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 23
dl 0
loc 104
ccs 22
cts 22
cp 1
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 7 1
A getViewWindow() 0 3 1
A getTitleTextStyle() 0 3 1
A getGridlines() 0 3 1
A getMinorGridlines() 0 3 1
A setTextPosition() 0 5 1
A setViewWindowMode() 0 5 1
A getTextStyle() 0 3 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class HAxis
9
{
10
    use TitleTrait;
11
12
    /**
13
     * @var Gridlines
14
     */
15
    protected $gridlines;
16
17
    /**
18
     * @var MinorGridlines
19
     */
20
    protected $minorGridlines;
21
22
    /**
23
     * Position of the horizontal axis text, relative to the chart area. Supported values: 'out', 'in', 'none'.
24
     *
25
     * @var string
26
     */
27
    protected $textPosition;
28
29
    /**
30
     * @var MediumTextStyle
31
     */
32
    protected $textStyle;
33
34
    /**
35
     * @var TitleTextStyle
36
     */
37
    protected $titleTextStyle;
38
39
    /**
40
     * @var ViewWindow
41
     */
42
    protected $viewWindow;
43
44
    /**
45
     * Specifies how to scale the vertical axis to render the values within the chart area. The following string
46
     * values are supported:
47
     * 'pretty' - Scale the vertical values so that the maximum and minimum data values are rendered a bit inside the
48
     *   top and bottom of the chart area. This will cause vaxis.viewWindow.min and vaxis.viewWindow.max to be ignored.
49
     * 'maximized' - Scale the vertical values so that the maximum and minimum data values touch the top and bottom
50
     *   of the chart area. This will cause vaxis.viewWindow.min and vaxis.viewWindow.max to be ignored.
51
     * 'explicit' - A deprecated option for specifying the top and bottom scale values of the chart area.
52
     *   (Deprecated because it's redundant with vaxis.viewWindow.min and vaxis.viewWindow.max. Data values outside
53
     *   these values will be cropped. You must specify a vAxis.viewWindow object describing the maximum and minimum
54
     *   values to show.
55
     *
56
     * @var string
57
     */
58
    protected $viewWindowMode;
59
60 11
    public function __construct()
61
    {
62 11
        $this->gridlines = new Gridlines();
63 11
        $this->minorGridlines = new MinorGridlines();
64 11
        $this->textStyle = new MediumTextStyle();
65 11
        $this->titleTextStyle = new TitleTextStyle();
66 11
        $this->viewWindow = new ViewWindow();
67
    }
68
69 2
    public function getGridlines(): Gridlines
70
    {
71 2
        return $this->gridlines;
72
    }
73
74 2
    public function getMinorGridlines(): MinorGridlines
75
    {
76 2
        return $this->minorGridlines;
77
    }
78
79 2
    public function getTextStyle(): MediumTextStyle
80
    {
81 2
        return $this->textStyle;
82
    }
83
84 2
    public function getTitleTextStyle(): TitleTextStyle
85
    {
86 2
        return $this->titleTextStyle;
87
    }
88
89 2
    public function getViewWindow(): ViewWindow
90
    {
91 2
        return $this->viewWindow;
92
    }
93
94
    /**
95
     * @return $this
96
     */
97 2
    public function setTextPosition(string $textPosition)
98
    {
99 2
        $this->textPosition = $textPosition;
100
101 2
        return $this;
102
    }
103
104
    /**
105
     * @return $this
106
     */
107 2
    public function setViewWindowMode(string $viewWindowMode)
108
    {
109 2
        $this->viewWindowMode = $viewWindowMode;
110
111 2
        return $this;
112
    }
113
}
114