]> arthur.barton.de Git - netdata.git/blobdiff - web/netdata.js
prevent removing gridlines if time is not specified
[netdata.git] / 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;
+       }
 }