|
@@ -54,9 +54,11 @@ struct GlucoseChartView: ChartContent {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if isSmoothingEnabled, let smoothedGlucose = item.smoothedGlucose, smoothedGlucose != 0 {
|
|
if isSmoothingEnabled, let smoothedGlucose = item.smoothedGlucose, smoothedGlucose != 0 {
|
|
|
|
|
+ let smoothedGlucoseForDisplay: Decimal = units == .mgdL ? smoothedGlucose.decimalValue : smoothedGlucose
|
|
|
|
|
+ .decimalValue.asMmolL
|
|
|
LineMark(
|
|
LineMark(
|
|
|
x: .value("Time", item.date ?? Date(), unit: .second),
|
|
x: .value("Time", item.date ?? Date(), unit: .second),
|
|
|
- y: .value("Value", smoothedGlucose as Decimal),
|
|
|
|
|
|
|
+ y: .value("Value", smoothedGlucoseForDisplay),
|
|
|
series: .value("Type", "Smoothed")
|
|
series: .value("Type", "Smoothed")
|
|
|
)
|
|
)
|
|
|
.foregroundStyle(Color.secondary)
|
|
.foregroundStyle(Color.secondary)
|