]> arthur.barton.de Git - netdata.git/commitdiff
prevent removing gridlines if time is not specified
authorCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 22 Nov 2015 00:02:30 +0000 (02:02 +0200)
committerCosta Tsaousis (ktsaou) <costa@tsaousis.gr>
Sun, 22 Nov 2015 00:02:30 +0000 (02:02 +0200)
web/netdata.js

index 9c7c54e8582cbbb29c77371124b2c8d8dda2eb73..34357d03b58a4a5ea6dcf2988c2348490bf001a3 100755 (executable)
@@ -198,11 +198,14 @@ function calculateChartPointsToShow(c, divisor, maxtime, group) {
        else
                c.chartOptions.curveType = c.default_curveType;
 
-       var hpoints = Math.round(maxtime / 30);
-       if(hpoints > 10) hpoints = 10;
-
-       c.chartOptions.hAxis.gridlines = { "count": hpoints, "color": '#EEE' };
+       c.chartOptions.hAxis.gridlines = { "color": '#EEE' };
        c.chartOptions.vAxis.gridlines = { "color": '#EEE' };
+       
+       if(maxtime) {
+               var hpoints = Math.round(maxtime / 30);
+               if(hpoints > 10) hpoints = 10;
+               c.chartOptions.hAxis.gridlines.count = hpoints;
+       }
 }