From ef4903253dee210c313a1b9d313a6b6cf5d62b5f Mon Sep 17 00:00:00 2001 From: Sebastian Lenz Date: Thu, 16 Jan 2020 12:45:55 +0100 Subject: [PATCH] Fix scaling of the activity graph --- .../plugins/general/overview/graphData/GraphData.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.java b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.java index a3dc3c4212..dec943365c 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphData/GraphData.java @@ -371,7 +371,8 @@ public class GraphData { actArrayHist.add(new ScaledDataPoint(time, act, actScale)); else actArrayPred.add(new ScaledDataPoint(time, act, actScale)); - if (act > maxIAValue) maxIAValue = act; + + maxIAValue = Math.max(maxIAValue, Math.abs(act)); } ScaledDataPoint[] actData = new ScaledDataPoint[actArrayHist.size()];