Trendlines::setShowR2()   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 2
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
c 2
b 0
f 0
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class Trendlines
9
{
10
    use ColorTrait;
11
12
    use LineWidthTrait;
13
14
    use OpacityTrait;
15
16
    use PointSizeTrait;
17
18
    use PointsVisibleTrait;
19
20
    /**
21
     * For trendlines of type: 'polynomial', the degree of the polynomial (2 for quadratic, 3 for cubic, and so on).
22
     * (The default degree may change from 3 to 2 in an upcoming release of Google Charts.).
23
     *
24
     * @var int
25
     */
26
    protected $degree;
27
28
    /**
29
     * If set, the trendline will appear in the legend as this string.
30
     *
31
     * @var string
32
     */
33
    protected $labelInLegend;
34
35
    /**
36
     * Whether to show the coefficient of determination in the legend or trendline tooltip.
37
     *
38
     * @var bool
39
     */
40
    protected $showR2;
41
42
    /**
43
     * Whether the trendlines is 'linear' (the default), 'exponential', or 'polynomial'.
44
     *
45
     * @var string
46
     */
47
    protected $type;
48
49
    /**
50
     * Whether the trendline equation appears in the legend. (It will appear in the trendline tooltip.).
51
     *
52
     * @var bool
53
     */
54
    protected $visibleInLegend;
55
56
    /**
57
     * @return $this
58
     */
59
    public function setVisibleInLegend(bool $visibleInLegend)
60
    {
61
        $this->visibleInLegend = $visibleInLegend;
62
63
        return $this;
64
    }
65
66
    /**
67
     * @return $this
68
     */
69
    public function setDegree(int $degree)
70
    {
71
        $this->degree = $degree;
72
73
        return $this;
74
    }
75
76
    /**
77
     * @return $this
78
     */
79
    public function setLabelInLegend(string $labelInLegend)
80
    {
81
        $this->labelInLegend = $labelInLegend;
82
83
        return $this;
84
    }
85
86
    /**
87
     * @return $this
88
     */
89
    public function setShowR2(bool $showR2)
90
    {
91
        $this->showR2 = $showR2;
92
93
        return $this;
94
    }
95
96
    /**
97
     * @return $this
98
     */
99
    public function setType(string $type)
100
    {
101
        $this->type = $type;
102
103
        return $this;
104
    }
105
}
106