|
|
@@ -42,6 +42,7 @@ struct MainChartView: View {
|
|
|
@Binding var basalProfile: [BasalProfileEntry]
|
|
|
@Binding var tempTargets: [TempTarget]
|
|
|
@Binding var carbs: [CarbsEntry]
|
|
|
+ @Binding var timerDate: Date
|
|
|
let units: GlucoseUnits
|
|
|
|
|
|
@State var didAppearTrigger = false
|
|
|
@@ -196,16 +197,25 @@ struct MainChartView: View {
|
|
|
}
|
|
|
|
|
|
private func xGridView(fullSize: CGSize) -> some View {
|
|
|
- Path { path in
|
|
|
- for hour in 0 ..< hours + hours {
|
|
|
- let x = firstHourPosition(viewWidth: fullSize.width) +
|
|
|
- oneSecondStep(viewWidth: fullSize.width) *
|
|
|
- CGFloat(hour) * CGFloat(1.hours.timeInterval)
|
|
|
+ ZStack {
|
|
|
+ Path { path in
|
|
|
+ for hour in 0 ..< hours + hours {
|
|
|
+ let x = firstHourPosition(viewWidth: fullSize.width) +
|
|
|
+ oneSecondStep(viewWidth: fullSize.width) *
|
|
|
+ CGFloat(hour) * CGFloat(1.hours.timeInterval)
|
|
|
+ path.move(to: CGPoint(x: x, y: 0))
|
|
|
+ path.addLine(to: CGPoint(x: x, y: fullSize.height - 20))
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .stroke(Color.secondary, lineWidth: 0.2)
|
|
|
+
|
|
|
+ Path { path in
|
|
|
+ let x = timeToXCoordinate(timerDate.timeIntervalSince1970, fullSize: fullSize)
|
|
|
path.move(to: CGPoint(x: x, y: 0))
|
|
|
path.addLine(to: CGPoint(x: x, y: fullSize.height - 20))
|
|
|
}
|
|
|
+ .stroke(Color.secondary, style: StrokeStyle(lineWidth: 0.2, dash: [5]))
|
|
|
}
|
|
|
- .stroke(Color.secondary, lineWidth: 0.2)
|
|
|
}
|
|
|
|
|
|
private func timeLabelsView(fullSize: CGSize) -> some View {
|