Total Complexity | 5 |
Total Lines | 96 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 5 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
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) |
||
84 | } |
||
85 | |||
86 | /** |
||
87 | * @return $this |
||
88 | */ |
||
89 | public function setShowR2(bool $showR2) |
||
94 | } |
||
95 | |||
96 | /** |
||
97 | * @return $this |
||
98 | */ |
||
99 | public function setType(string $type) |
||
104 | } |
||
105 | } |
||
106 |