MediumChartOptions::getChartArea()   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;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class MediumChartOptions extends BasicChartOptions
9
{
10
    use ColorsTrait;
11
12
    use FontNameTrait;
13
14
    use FontSizeTrait;
15
16
    use TitleTrait;
17
18
    /**
19
     * The background color for the main area of the chart. Can be either a simple HTML color string, for example :
20
     * 'red' or '#00cc00', or a BackgroundColor object.
21
     *
22
     * @var string|AdvancedBackgroundColor
23
     */
24
    protected $backgroundColor;
25
26
    /**
27
     * An object with members to configure the placement and size of the chart area (where the chart itself is drawn,
28
     * excluding axis and legends).
29
     *
30
     * @var ChartArea
31
     */
32
    protected $chartArea;
33
34
    /**
35
     * @var TitleTextStyle
36
     */
37
    protected $titleTextStyle;
38
39 11
    public function __construct()
40
    {
41 11
        parent::__construct();
42
43 11
        $this->backgroundColor = new AdvancedBackgroundColor();
44 11
        $this->chartArea = new ChartArea();
45 11
        $this->titleTextStyle = new TitleTextStyle();
46
    }
47
48
    /**
49
     * @return string|AdvancedBackgroundColor
50
     */
51 2
    public function getBackgroundColor()
52
    {
53 2
        return $this->backgroundColor;
54
    }
55
56 2
    public function getChartArea(): ChartArea
57
    {
58 2
        return $this->chartArea;
59
    }
60
61 2
    public function getTitleTextStyle(): TitleTextStyle
62
    {
63 2
        return $this->titleTextStyle;
64
    }
65
66
    /**
67
     * @return $this
68
     */
69
    public function setBackgroundColor(string $backgroundColor)
70
    {
71
        $this->backgroundColor = $backgroundColor;
72
73
        return $this;
74
    }
75
}
76