aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/AppBundle/Controller/AllDataAverageController.php4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/AppBundle/Controller/AllDataAverageController.php b/src/AppBundle/Controller/AllDataAverageController.php
index 439058a..87a9d7c 100644
--- a/src/AppBundle/Controller/AllDataAverageController.php
+++ b/src/AppBundle/Controller/AllDataAverageController.php
@@ -28,6 +28,10 @@ class AllDataAverageController extends Controller
$readings = array();
+ usort($data, function($a,$b){
+ return $a['TimeStamp'] - $b['TimeStamp'];
+ });
+
foreach($data as $index => $item)
{