From 1b6459695351114378d5736080557a731a95b5f9 Mon Sep 17 00:00:00 2001 From: charithag Date: Fri, 7 Aug 2015 19:50:07 +0530 Subject: [PATCH] Fix scaling bug --- .../units/analytics/public/js/graph_util.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js index b9e23d89..d5eed181 100644 --- a/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js +++ b/modules/distribution/src/repository/jaggeryapps/iotserver/units/analytics/public/js/graph_util.js @@ -322,20 +322,20 @@ function drawLineGraph(graphId, chartDataRaw) { var y_val = parseInt(chartDataRaw[i].stats[j].value); if (y_val > max_val) { max_val = y_val; - if (range_max < max_val) { - range_max = max_val; - } } else if (y_val < min_val) { min_val = y_val; - if (range_min > min_val) { - range_min = min_val; - } } chartData.push({ x: parseInt(chartDataRaw[i].stats[j].time), y: y_val }); } + if (range_max < max_val) { + range_max = max_val; + } + if (range_min > min_val) { + range_min = min_val; + } graphConfig['series'].push({ 'color': color[k], 'data': summerizeLine(chartData),