diff options
| author | 2014-09-29 18:54:03 -0400 | |
|---|---|---|
| committer | 2014-09-29 18:54:03 -0400 | |
| commit | cd88414abcffd94cfce933cf578ecc640b691381 (patch) | |
| tree | bcc2166c49d7139e3ef7191abcdd7353f11d12ea /app/views/stats | |
| parent | 3d288eb170091c2679cac34ee09e850b56e46861 (diff) | |
Add an average per day for the 30 day period
Diffstat (limited to 'app/views/stats')
| -rw-r--r-- | app/views/stats/index.phtml | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/views/stats/index.phtml b/app/views/stats/index.phtml index 31185fbe3..9b19cb560 100644 --- a/app/views/stats/index.phtml +++ b/app/views/stats/index.phtml @@ -93,12 +93,22 @@ function initStats() { return; } // Entry per day + var avg = []; + for (var i = -31; i <= 0; i++) { + avg.push([i, <?php echo $this->average?>]); + } Flotr.draw(document.getElementById('statsEntryPerDay'), - [<?php echo $this->count ?>], + [{ + data: <?php echo $this->count ?>, + bars: {horizontal: false, show: true} + },{ + data: avg, + lines: {show: true}, + label: <?php echo $this->average?> + }], { grid: {verticalLines: false}, - bars: {horizontal: false, show: true}, - xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0}, + xaxis: {noTicks: 6, showLabels: false, tickDecimals: 0, min: -30.75, max: -0.25}, yaxis: {min: 0}, mouse: {relative: true, track: true, trackDecimals: 0, trackFormatter: function(obj) {return numberFormat(obj.y);}} }); |
