JNP3 16/17

Dependencies:   mbed nRF24L01P

Revision:
24:a929fcdb1208
Parent:
23:e643afa16ad1
Child:
25:4fd33808f095
--- a/frontend/kubus.js	Mon Jan 09 19:14:08 2017 +0100
+++ b/frontend/kubus.js	Mon Jan 09 19:24:43 2017 +0100
@@ -3,6 +3,7 @@
 Chart.defaults.global.defaultFontColor = "#efefef";
 
 const UPDATE_INTERVAL_SECONDS = 5;
+const KEEP_DATA_POINTS = 10;
 
 class Charts {
     constructor(containerId) {
@@ -78,7 +79,7 @@
         this.chart.data.datasets[0].data.push(dataPoint);
         this.dataSize++;
 
-        if (this.dataSize > 10) {
+        if (this.dataSize > KEEP_DATA_POINTS) {
             this.chart.data.datasets[0].data.shift();
             this.dataSize--;
         }