From 2a93e059b1658ea0487da33eb496d02163370e26 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Tue, 4 Oct 2022 12:20:26 +0200 Subject: [PATCH] Display timeshit in overview graph --- .../graphExtensions/EffectiveProfileSwitchDataPoint.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt index 716a0fd0b7..57de803f7b 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt +++ b/app/src/main/java/info/nightscout/androidaps/plugins/general/overview/graphExtensions/EffectiveProfileSwitchDataPoint.kt @@ -4,6 +4,7 @@ import android.content.Context import info.nightscout.androidaps.core.R import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch import info.nightscout.androidaps.interfaces.ResourceHelper +import info.nightscout.androidaps.utils.T class EffectiveProfileSwitchDataPoint( val data: EffectiveProfileSwitch, @@ -14,7 +15,11 @@ class EffectiveProfileSwitchDataPoint( override fun getX(): Double = data.timestamp.toDouble() override fun getY(): Double = scale.transform(data.originalPercentage.toDouble()) override fun setY(y: Double) {} - override val label get() = if (data.originalPercentage != 100) data.originalPercentage.toString() + "%" else "" + override val label + get() = "" + + (if (data.originalPercentage != 100) "${data.originalPercentage}%" else "") + + (if (data.originalPercentage != 100 && data.originalTimeshift != 0L) "," else "") + + (if (data.originalTimeshift != 0L) (T.msecs(data.originalTimeshift).hours().toString() + rh.gs(R.string.shorthour)) else "") override val duration = 0L override val shape = PointsWithLabelGraphSeries.Shape.PROFILE override val size = 2f