|
|
@@ -137,7 +137,7 @@ struct InsulinSensitivityStepView: View {
|
|
|
private var isfChart: some View {
|
|
|
Chart {
|
|
|
ForEach(Array(state.isfItems.enumerated()), id: \.element.id) { index, item in
|
|
|
- let displayValue = state.isfRateValues[item.rateIndex]
|
|
|
+ let displayValue = state.units == .mgdL ? state.isfRateValues[item.rateIndex] : state.isfRateValues[item.rateIndex].asMmolL
|
|
|
|
|
|
let startDate = Calendar.current
|
|
|
.startOfDay(for: now)
|
|
|
@@ -188,8 +188,12 @@ struct InsulinSensitivityStepView: View {
|
|
|
.addingTimeInterval(60 * 60 * 24)
|
|
|
)
|
|
|
.chartYAxis {
|
|
|
- AxisMarks(values: .automatic(desiredCount: 4)) { _ in
|
|
|
- AxisValueLabel()
|
|
|
+ AxisMarks(values: .automatic(desiredCount: 4)) { value in
|
|
|
+ if let val = value.as(Double.self) {
|
|
|
+ AxisValueLabel {
|
|
|
+ Text(numberFormatter.string(from: NSNumber(value: val)) ?? "")
|
|
|
+ }
|
|
|
+ }
|
|
|
AxisGridLine(centered: true, stroke: StrokeStyle(lineWidth: 1, dash: [2, 4]))
|
|
|
}
|
|
|
}
|