Display timeshit in overview graph

This commit is contained in:
Milos Kozak 2022-10-04 12:20:26 +02:00
parent 2e3ce68e3d
commit 2a93e059b1

View file

@ -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