fixed averaging
authorAndrew Tridgell <tridge@samba.org>
Sun, 17 Oct 2010 04:58:01 +0000 (15:58 +1100)
committerAndrew Tridgell <tridge@samba.org>
Sun, 17 Oct 2010 04:58:01 +0000 (15:58 +1100)
live/graphs.js

index d8585bb450b04e7dcc3557038fb5e212b8d82523..7115966c062a27c3482cf6b889dc9c57f2ac7976 100644 (file)
@@ -763,8 +763,8 @@ function average_data(data, n) {
       }
     }
     var y2 = ret.length;
-    if (ret.length > 0 && t == ret[ret.length-1][0]) {
-      y2 = ret.length-1;
+    if (ret.length > 0 && t.getTime() == ret[ret.length-1][0].getTime()) {
+      var y2 = ret.length-1;
       for (var x=1; x<data[y].length; x++) {
        if (data[y][x] != null) {
          ret[y2][x] += data[y][x];