Display timeshit in overview graph
This commit is contained in:
parent
2e3ce68e3d
commit
2a93e059b1
1 changed files with 6 additions and 1 deletions
|
@ -4,6 +4,7 @@ import android.content.Context
|
||||||
import info.nightscout.androidaps.core.R
|
import info.nightscout.androidaps.core.R
|
||||||
import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch
|
import info.nightscout.androidaps.database.entities.EffectiveProfileSwitch
|
||||||
import info.nightscout.androidaps.interfaces.ResourceHelper
|
import info.nightscout.androidaps.interfaces.ResourceHelper
|
||||||
|
import info.nightscout.androidaps.utils.T
|
||||||
|
|
||||||
class EffectiveProfileSwitchDataPoint(
|
class EffectiveProfileSwitchDataPoint(
|
||||||
val data: EffectiveProfileSwitch,
|
val data: EffectiveProfileSwitch,
|
||||||
|
@ -14,7 +15,11 @@ class EffectiveProfileSwitchDataPoint(
|
||||||
override fun getX(): Double = data.timestamp.toDouble()
|
override fun getX(): Double = data.timestamp.toDouble()
|
||||||
override fun getY(): Double = scale.transform(data.originalPercentage.toDouble())
|
override fun getY(): Double = scale.transform(data.originalPercentage.toDouble())
|
||||||
override fun setY(y: Double) {}
|
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 duration = 0L
|
||||||
override val shape = PointsWithLabelGraphSeries.Shape.PROFILE
|
override val shape = PointsWithLabelGraphSeries.Shape.PROFILE
|
||||||
override val size = 2f
|
override val size = 2f
|
||||||
|
|
Loading…
Reference in a new issue