@cryptotaxi247 / netdata-1 / commits / d217fd1ff

remove line when the chart is too dense

Costa Tsaousis (ktsaou) committed Apr 25, 2014 at 01:47 UTC d217fd1ffa187f0cf5a86482e550a21609deff2f
1 file changed +8
web/netdata.js
+8
@@ -151,6 +151,7 @@ function calculateChartPointsToShow(c, divisor, maxtime, group) {
151 }
152 mylog('group = ' + c.group + ', points = ' + c.points_to_show);
153
154 + // make sure the line width is not congesting the chart
155 if(c.chartType == 'LineChart') {
156 if(c.points_to_show > c.chartOptions.width / 2) {
157 c.chartOptions.lineWidth = 1;
@@ -167,6 +168,13 @@ function calculateChartPointsToShow(c, divisor, maxtime, group) {
168 c.chartOptions.curveType = 'function';
169 }
170 }
171 + else if(c.chartType == 'AreaChart') {
172 + if(c.points_to_show > c.chartOptions.width / 2)
173 + c.chartOptions.lineWidth = 0;
174 +
175 + else
176 + c.chartOptions.lineWidth = 1;
177 + }
178 }
179
180