Test Failed
Push — master ( e6b57e...dd7c2d )
by Christophe
07:44
created

AggregationTargetTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 40
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A setAggregationTarget() 0 6 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
trait AggregationTargetTrait
9
{
10
    /**
11
     * How multiple data selections are rolled up into tooltips :
12
     * 'category': group selected data by x-value.
13
     * 'series': group selected data by series.
14
     * 'auto': group selected data by x-value if all selections have the same x-value, and by series otherwise.
15
     * 'none': show only one tooltip per selection.
16
     *
17
     * aggregationTarget will often be used in tandem with selectionMode and tooltip.trigger, e.g.:
18
     * var options = {
19
     *     // Allow multiple
20
     *     // simultaneous selections.
21
     *     selectionMode: 'multiple',
22
     *     // Trigger tooltips
23
     *     // on selections.
24
     *     tooltip: {trigger: 'selection'},
25
     *     // Group selections
26
     *     // by x-value.
27
     *     aggregationTarget: 'category',
28
     * };
29
     *
30
     * Default: 'auto'
31
     *
32
     * @var string
33
     */
34
    protected $aggregationTarget;
35
36
    /**
37
     * @param string $aggregationTarget
38
     *
39
     * @return $this
40
     */
41
    public function setAggregationTarget($aggregationTarget)
42
    {
43
        $this->aggregationTarget = $aggregationTarget;
44
45
        return $this;
46
    }
47
}
48