BubbleChartOptions::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 9
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 12
ccs 0
cts 10
cp 0
crap 2
rs 9.9666
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\BubbleChart;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedAnimation;
6
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedChartOptions;
7
use CMEN\GoogleChartsBundle\GoogleCharts\Options\AdvancedLegend;
8
use CMEN\GoogleChartsBundle\GoogleCharts\Options\BasicTooltip;
9
use CMEN\GoogleChartsBundle\GoogleCharts\Options\Explorer;
10
use CMEN\GoogleChartsBundle\GoogleCharts\Options\MediumHAxis;
11
use CMEN\GoogleChartsBundle\GoogleCharts\Options\SelectionModeTrait;
12
use CMEN\GoogleChartsBundle\GoogleCharts\Options\SizeAxis;
13
14
/**
15
 * @author Christophe Meneses
16
 */
17
class BubbleChartOptions extends AdvancedChartOptions
18
{
19
    use SelectionModeTrait;
20
21
    /**
22
     * @var AdvancedAnimation
23
     */
24
    protected $animation;
25
26
    /**
27
     * @var Bubble
28
     */
29
    protected $bubble;
30
31
    /**
32
     * @var ColorAxis
33
     */
34
    protected $colorAxis;
35
36
    /**
37
     * @var Explorer
38
     */
39
    protected $explorer;
40
41
    /**
42
     * @var MediumHAxis
43
     */
44
    protected $hAxis;
45
46
    /**
47
     * @var AdvancedLegend
48
     */
49
    protected $legend;
50
51
    /**
52
     * @var SizeAxis
53
     */
54
    protected $sizeAxis;
55
56
    /**
57
     * If true, sorts the bubbles by size so the smaller bubbles appear above the larger bubbles. If false, bubbles
58
     * are sorted according to their order in the DataTable.
59
     *
60
     * @var bool
61
     */
62
    protected $sortBubblesBySize;
63
64
    /**
65
     * @var BasicTooltip
66
     */
67
    protected $tooltip;
68
69
    public function __construct()
70
    {
71
        parent::__construct();
72
73
        $this->animation = new AdvancedAnimation();
74
        $this->bubble = new Bubble();
75
        $this->colorAxis = new ColorAxis();
76
        $this->explorer = new Explorer();
77
        $this->hAxis = new MediumHAxis();
78
        $this->legend = new AdvancedLegend();
79
        $this->sizeAxis = new SizeAxis();
80
        $this->tooltip = new BasicTooltip();
81
    }
82
83
    public function getAnimation(): AdvancedAnimation
84
    {
85
        return $this->animation;
86
    }
87
88
    public function getBubble(): Bubble
89
    {
90
        return $this->bubble;
91
    }
92
93
    public function getColorAxis(): ColorAxis
94
    {
95
        return $this->colorAxis;
96
    }
97
98
    public function getExplorer(): Explorer
99
    {
100
        return $this->explorer;
101
    }
102
103
    public function getHAxis(): MediumHAxis
104
    {
105
        return $this->hAxis;
106
    }
107
108
    public function getLegend(): AdvancedLegend
109
    {
110
        return $this->legend;
111
    }
112
113
    public function getSizeAxis(): SizeAxis
114
    {
115
        return $this->sizeAxis;
116
    }
117
118
    public function getTooltip(): BasicTooltip
119
    {
120
        return $this->tooltip;
121
    }
122
123
    /**
124
     * @return $this
125
     */
126
    public function setSortBubblesBySize(bool $sortBubblesBySize)
127
    {
128
        $this->sortBubblesBySize = $sortBubblesBySize;
129
130
        return $this;
131
    }
132
}
133