Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-04-07 04:25:22 +0400
committermatt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105>2009-04-07 04:25:22 +0400
commitb885a9cbb2f1028403d39904f585a5d2c1ec4c8a (patch)
tree1da9ff533e50aa33f28a66c3f335b3deef814a13 /core
parent9103ff7dc98f746bc889f73be0d878c4a3cb5f14 (diff)
Diffstat (limited to 'core')
-rw-r--r--core/ViewDataTable/GenerateGraphData/ChartEvolution.php17
-rw-r--r--core/ViewDataTable/Sparkline.php4
2 files changed, 8 insertions, 13 deletions
diff --git a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php
index cec987e5b6..0dd6c56468 100644
--- a/core/ViewDataTable/GenerateGraphData/ChartEvolution.php
+++ b/core/ViewDataTable/GenerateGraphData/ChartEvolution.php
@@ -12,7 +12,6 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat
{
return 'generateDataChartEvolution';
}
-
function __construct()
{
require_once "Visualization/Chart/Evolution.php";
@@ -25,34 +24,26 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat
private function generateLine( $dataArray, $columns, $schema = "##label## ##column##" )
{
$data = array();
-
foreach($dataArray as $keyName => $table)
{
$table->applyQueuedFilters();
-
// initialize data (default values for all lines is 0)
$dataRow = array();
-
$rows = $table->getRows();
-
foreach($rows as $row)
{
$rowLabel = $schema;
-
if( strpos($rowLabel, "##label##") !== false )
{
$rowLabel = str_replace("##label##", $row->getColumn('label'), $rowLabel);
}
-
foreach($columns as $col)
{
$label = $rowLabel;
-
if( strpos($label, "##column##") !== false )
{
$label = str_replace("##column##", $col, $label);
}
-
if( !isset($this->lineLabels[$label]) )
{
$this->lineLabels[$label] = count($this->lineLabels);
@@ -120,7 +111,7 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat
// for numeric we want to have only one column name
if( count($columnsToDisplay) != 1 )
{
- $columnsToDisplay = array( 'nb_uniq_visitors' );
+ $columnsToDisplay = array( 'nb_visits' );
}
$label = $siteLabel . array_shift($columnsToDisplay);
@@ -131,17 +122,17 @@ class Piwik_ViewDataTable_GenerateGraphData_ChartEvolution extends Piwik_ViewDat
}
/*
- * generates data for evolution graph from a DataTable that has named columns (i.e. 'nb_hits', 'nb_uniq_visitors')
+ * generates data for evolution graph from a DataTable that has named columns (i.e. 'nb_hits', 'nb_visits')
*/
protected function generateDataFromRegularDataTable($dataArray, $siteLabel = "")
{
- // get list of columns to display i.e. array('nb_hits','nb_uniq_visitors')
+ // get list of columns to display i.e. array('nb_hits','nb_visits')
$columnsToDisplay = Piwik_Common::getRequestVar('columns', array(), 'array');
// default column
if( count($columnsToDisplay) == 0 )
{
- $columnsToDisplay = array( 'nb_uniq_visitors' );
+ $columnsToDisplay = array( 'nb_visits' );
}
$this->addArray($this->data, $this->generateLabels($dataArray));
diff --git a/core/ViewDataTable/Sparkline.php b/core/ViewDataTable/Sparkline.php
index 272ef19519..8b694468ee 100644
--- a/core/ViewDataTable/Sparkline.php
+++ b/core/ViewDataTable/Sparkline.php
@@ -97,6 +97,10 @@ class Piwik_ViewDataTable_Sparkline extends Piwik_ViewDataTable
// and we would build automatically the dataTable_array of datatatble_simple from these integers
// but we'd have to add this integer to be recorded during archiving etc.
$value = $onlyRow->getColumn('nb_uniq_visitors');
+ if($value === false)
+ {
+ $value = $onlyRow->getColumn('nb_visits');
+ }
}
}