From bc48498ff676bc87e947fde805f997c256e47dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=C3=B3jcik?= Date: Tue, 20 Nov 2018 15:29:00 +0100 Subject: [PATCH] Fixing the bottom line to always show, and don't vanish --- .../modules/monitoring/js/directives/ui.particular.graph.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ServicePulse.Host/app/modules/monitoring/js/directives/ui.particular.graph.js b/src/ServicePulse.Host/app/modules/monitoring/js/directives/ui.particular.graph.js index 0fb40f8c0f..5d46e68c60 100644 --- a/src/ServicePulse.Host/app/modules/monitoring/js/directives/ui.particular.graph.js +++ b/src/ServicePulse.Host/app/modules/monitoring/js/directives/ui.particular.graph.js @@ -14,9 +14,6 @@ template: '', link: function link(scope, element, attrs) { scope.plotData = scope.plotData || { points: [], average: 0 }; - if (scope.plotData.points.length === 0) { - scope.plotData.points = new Array(10).fill(0); - } scope.$watch('plotData', function() { @@ -37,6 +34,9 @@ var horizontalMargin = 2; var points = scope.plotData.points; + if (points.length === 0) { + points = new Array(10).fill(0); + } var average = scope.plotData.average || 0; var minimumYaxis = !isNaN(scope.minimumYaxis) ? Number(scope.minimumYaxis) : 10; var max = points && points.length ? Math.max(average * 1.5, d3.max(points), minimumYaxis) : 1;