diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-11-22 02:02:30 +0200 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2015-11-22 02:02:30 +0200 |
commit | 4d2cc37f7dd5e0919c6384b62382c8226f80b7a5 (patch) | |
tree | 4563fa18c605b8ab14286dd19a71429b3e1ad1eb | |
parent | 21e664cdb1232b12db210b60a362a5f38499722a (diff) |
prevent removing gridlines if time is not specified
-rwxr-xr-x | web/netdata.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/web/netdata.js b/web/netdata.js index 9c7c54e858..34357d03b5 100755 --- a/web/netdata.js +++ b/web/netdata.js @@ -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; + } } |