Skip to content

Commit

Permalink
refs matomo-org#6807 sort sparklines depending on the column that is …
Browse files Browse the repository at this point in the history
…selected in evolution column
  • Loading branch information
tsteur committed Dec 9, 2014
1 parent d974ea9 commit c9aace8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion plugins/MultiSites/angularjs/site/site.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,21 @@
append = '&token_auth=' + token_auth;
}

return piwik.piwik_url + '?module=MultiSites&action=getEvolutionGraph&period=' + $scope.period + '&date=' + $scope.dateSparkline + '&evolutionBy=' +$scope.metric + '&columns=' + $scope.metric + '&idSite=' + website.idsite + '&idsite=' + website.idsite + '&viewDataTable=sparkline' + append + '&colors=' + encodeURIComponent(JSON.stringify(piwik.getSparklineColors()));
var metric = $scope.metric;

switch ($scope.evolutionMetric) {
case 'visits_evolution':
metric = 'nb_visits';
break;
case 'pageviews_evolution':
metric = 'nb_pageviews';
break;
case 'revenue_evolution':
metric = 'revenue';
break;
}

return piwik.piwik_url + '?module=MultiSites&action=getEvolutionGraph&period=' + $scope.period + '&date=' + $scope.dateSparkline + '&evolutionBy=' + metric + '&columns=' + metric + '&idSite=' + website.idsite + '&idsite=' + website.idsite + '&viewDataTable=sparkline' + append + '&colors=' + encodeURIComponent(JSON.stringify(piwik.getSparklineColors()));
}
}
})();

0 comments on commit c9aace8

Please sign in to comment.