File: Config.php

package info (click to toggle)
matomo 5.5.1%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 73,596 kB
  • sloc: php: 231,041; javascript: 102,286; python: 202; xml: 189; sh: 172; makefile: 20; sql: 10
file content (121 lines) | stat: -rw-r--r-- 3,489 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<?php

/**
 * Matomo - free/libre analytics platform
 *
 * @link    https://matomo.org
 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 */

namespace Piwik\Plugins\CoreVisualizations\Visualizations\Graph;

use Piwik\ViewDataTable\Config as VisualizationConfig;

/**
 * DataTable Visualization that derives from HtmlTable and sets show_extra_columns to true.
 */
class Config extends VisualizationConfig
{
    /**
     * Whether the series picker should allow picking more than one series or not.
     *
     * Default value: true
     */
    public $allow_multi_select_series_picker = true;

    /**
     * The maximum number of rows to render. All other rows will be aggregated in an 'Others' row.
     *
     * Default value: false (no limit)
     */
    public $max_graph_elements = false;

    /**
     * Array property that contains the names of columns that can be selected in the Series Picker.
     *
     * Default value: false
     */
    public $selectable_columns = false;

    /**
     * Contains the column or metadata (if any) of the values used in the Row Picker.
     * The defined column or metadata will be used as identifier for the row, the label column will always be used as value
     *
     * @see self::ROWS_TO_DISPLAY
     *
     * Default value: false
     */
    public $row_picker_match_rows_by = false;

    /**
     * Contains the list of values identifying rows that should be displayed as separate series.
     * The values are of a specific column determined by the row_picker_match_rows_by column.
     *
     * @see self::ROW_PICKER_VALUE_COLUMN
     *
     * Default value: false
     */
    public $rows_to_display = false;

    /**
     * Contains the list of values available for the Row Picker. Currently set to be all visible
     * rows, if the row_picker_match_rows_by property is set.
     *
     * @see self::ROW_PICKER_VALUE_COLUMN
     */
    public $selectable_rows = [];

    /**
     * Controls whether all ticks & labels are shown on a graph's x-axis or just some.
     *
     * Default value: false
     */
    public $show_all_ticks = false;

    /**
     * If true, a row with totals of each DataTable column is added.
     *
     * Default value: false
     */
    public $add_total_row = false;

    /**
     * Controls whether the Series Picker is shown or not. The Series Picker allows users to
     * choose between displaying data of different columns.
     *
     * Default value: true
     */
    public $show_series_picker = true;

    /**
     * Controls whether the percentage of the total is displayed as a tooltip when hovering over
     * data points.
     *
     * NOTE: Sometimes this percentage is meaningless (when the total of the column values is
     * not the total number of elements in the set). In this case the tooltip should not be
     * displayed.
     *
     * Default value: true
     */
    public $display_percentage_in_tooltip = true;

    public function __construct()
    {
        parent::__construct();

        $this->show_limit_control = false;

        $this->addPropertiesThatShouldBeAvailableClientSide(array(
            'show_series_picker',
            'allow_multi_select_series_picker',
            'selectable_columns',
            'selectable_rows',
            'display_percentage_in_tooltip',
        ));

        $this->addPropertiesThatCanBeOverwrittenByQueryParams(array(
            'show_all_ticks',
            'show_series_picker',
        ));
    }
}