LineChartOptions::getLegend()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\LineChart;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnimation;
6
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedHAxis;
7
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedLegend;
8
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Annotations;
9
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Crosshair;
10
use CMEN\GoogleChartsBundle\GoogleCharts\Options\CurveTypeTrait;
11
use CMEN\GoogleChartsBundle\GoogleCharts\Options\DataOpacityTrait;
12
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Explorer;
13
use CMEN\GoogleChartsBundle\GoogleCharts\Options\FocusTargetTrait;
14
use CMEN\GoogleChartsBundle\GoogleCharts\Options\InterpolateNullsTrait;
15
use CMEN\GoogleChartsBundle\GoogleCharts\Options\LineOptions;
16
use CMEN\GoogleChartsBundle\GoogleCharts\Options\OrientationTrait;
17
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ReverseCategoriesTrait;
18
use CMEN\GoogleChartsBundle\GoogleCharts\Options\SelectionModeTrait;
19
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Trendlines;
20
use CMEN\GoogleChartsBundle\GoogleCharts\Options\VAxesTrait;
21
22
/**
23
 * @author Christophe Meneses
24
 */
25
class LineChartOptions extends LineOptions
26
{
27
    use CurveTypeTrait;
28
29
    use DataOpacityTrait;
30
31
    use FocusTargetTrait;
32
33
    use InterpolateNullsTrait;
34
35
    use OrientationTrait;
36
37
    use ReverseCategoriesTrait;
38
39
    use SelectionModeTrait;
40
41
    use VAxesTrait;
42
43
    /**
44
     * @var AdvancedAnimation
45
     */
46
    protected $animation;
47
48
    /**
49
     * @var Annotations
50
     */
51
    protected $annotations;
52
53
    /**
54
     * @var Crosshair
55
     */
56
    protected $crosshair;
57
58
    /**
59
     * @var Explorer
60
     */
61
    protected $explorer;
62
63
    /**
64
     * @var AdvancedHAxis
65
     */
66
    protected $hAxis;
67
68
    /**
69
     * @var AdvancedLegend
70
     */
71
    protected $legend;
72
73
    /**
74
     * Displays trendlines on the charts that support them. By default, linear trendlines are used, but this can be
75
     * customized with the trendlines.n.type option.
76
     *
77
     * @var Trendlines[]
78
     */
79
    protected $trendlines;
80
81 2
    public function __construct()
82
    {
83 2
        parent::__construct();
84
85 2
        $this->animation = new AdvancedAnimation();
86 2
        $this->annotations = new Annotations();
87 2
        $this->crosshair = new Crosshair();
88 2
        $this->explorer = new Explorer();
89 2
        $this->hAxis = new AdvancedHAxis();
90 2
        $this->legend = new AdvancedLegend();
91
    }
92
93 1
    public function getAnimation(): AdvancedAnimation
94
    {
95 1
        return $this->animation;
96
    }
97
98 1
    public function getAnnotations(): Annotations
99
    {
100 1
        return $this->annotations;
101
    }
102
103 1
    public function getCrosshair(): Crosshair
104
    {
105 1
        return $this->crosshair;
106
    }
107
108 1
    public function getExplorer(): Explorer
109
    {
110 1
        return $this->explorer;
111
    }
112
113 1
    public function getHAxis(): AdvancedHAxis
114
    {
115 1
        return $this->hAxis;
116
    }
117
118 1
    public function getLegend(): AdvancedLegend
119
    {
120 1
        return $this->legend;
121
    }
122
123
    /**
124
     * @param Trendlines[] $trendlines
125
     *
126
     * @return $this
127
     */
128 1
    public function setTrendlines(array $trendlines)
129
    {
130 1
        $this->trendlines = $trendlines;
131
132 1
        return $this;
133
    }
134
}
135