blob: efafc16d119859abc103699a057fb20588ff9aef (
plain)
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
|
<?php
class Piwik_ViewDataTable_GenerateGraphData extends Piwik_ViewDataTable
{
function __construct($typeViewRequested)
{
parent::__construct($typeViewRequested);
}
function init($currentControllerAction,
$moduleNameAndMethod )
{
parent::init($currentControllerAction,
$moduleNameAndMethod );
$this->disableOffsetInformation();
$this->disableExcludeLowPopulation();
$this->disableSearchBox();
}
public function main()
{
if($this->mainAlreadyExecuted)
{
return;
}
$this->mainAlreadyExecuted = true;
switch($this->typeViewRequested)
{
case 'generateDataChartPie':
require_once "Visualization/ChartPie.php";
$view = new Piwik_Visualization_ChartPie;
break;
default:
case 'generateDataChartVerticalBar':
require_once "Visualization/ChartVerticalBar.php";
$view = new Piwik_Visualization_ChartVerticalBar;
break;
}
$this->setDefaultLimit( $view->getDefaultLimit() );
$this->loadDataTableFromAPI();
// We apply a filter to the DataTable, decoding the label column (useful for keywords for example)
$filter = new Piwik_DataTable_Filter_ColumnCallbackReplace(
$this->dataTable,
'label',
'urldecode'
);
foreach($this->dataTable->getRows() as $row)
{
$label = $row->getColumn('label');
$value = $row->getColumn('nb_unique_visitors');
// case no unique visitors
if($value === false)
{
$value = $row->getColumn('nb_visits');
}
$data[] = array(
'label' => $label,
'value' => $value,
'url' => $row->getDetail('url'),
);
}
$view->setData($data);
$view->customizeGraph();
$this->view = $view;
}
}
?>
|