@cryptotaxi247 / netdata-1 / commits / 4d2cc37f7

prevent removing gridlines if time is not specified

Costa Tsaousis (ktsaou) committed Nov 22, 2015 at 02:02 UTC 4d2cc37f7dd5e0919c6384b62382c8226f80b7a5
1 file changed +7 -4
web/netdata.js
+7 -4
@@ -198,11 +198,14 @@ function calculateChartPointsToShow(c, divisor, maxtime, group) {
198 else
199 c.chartOptions.curveType = c.default_curveType;
200
201 - var hpoints = Math.round(maxtime / 30);
202 - if(hpoints > 10) hpoints = 10;
203 -
204 - c.chartOptions.hAxis.gridlines = { "count": hpoints, "color": '#EEE' };
201 + c.chartOptions.hAxis.gridlines = { "color": '#EEE' };
202 c.chartOptions.vAxis.gridlines = { "color": '#EEE' };
203 +
204 + if(maxtime) {
205 + var hpoints = Math.round(maxtime / 30);
206 + if(hpoints > 10) hpoints = 10;
207 + c.chartOptions.hAxis.gridlines.count = hpoints;
208 + }
209 }
210
211