Add graph animation; support for line graphs
[harbour-pedalo.git] / src / statsweekdayave.cpp
index 63e595e..c0bbd2b 100644 (file)
@@ -16,7 +16,7 @@ void StatsWeekdayAve::update() {
     int pos;
 
     qDebug() << "Calculating values";
-    values.clear();
+    barvalues.clear();
 
     for (pos = 0; pos < 7; pos++) {
         duration[pos] = 0.0;
@@ -41,10 +41,10 @@ void StatsWeekdayAve::update() {
         if (result > maxval) {
             maxval = result;
         }
-        values << result;
+        barvalues << result;
     }
 
-    step = qRound(maxval / 5.0);
+    step = maxval > 5.0 ? qRound(maxval / 5.0) : (maxval / 5.0);
 
     qDebug() << "Calculated values";
 }