Просмотр исходного кода

Revert "iob chart"

This reverts commit 2eb14010cd76a221ff2e0898668f9782ac157137.
polscm32 aka Marvout 1 год назад
Родитель
Сommit
22b6508c6f

+ 5 - 43
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -119,7 +119,6 @@ struct MainChartView: View {
                     staticYAxisChart
                     dummyBasalChart
                     dummyCobChart.offset(y: 20)
-                    dummyIobChart.offset(y: 40)
                 }
 
                 ScrollViewReader { scroller in
@@ -128,7 +127,6 @@ struct MainChartView: View {
                             mainChart
                             basalChart
                             cobChart.offset(y: 20)
-                            iobChart.offset(y: 40)
                         }.onChange(of: screenHours) { _ in
                             updateStartEndMarkers()
                             yAxisChartData()
@@ -195,7 +193,7 @@ extension MainChartView {
             }
         }
         .id("DummyMainChart")
-        .frame(minHeight: UIScreen.main.bounds.height * 0.01)
+        .frame(minHeight: UIScreen.main.bounds.height * 0.2)
         .frame(width: screenSize.width - 10)
         .chartYAxis { mainChartYAxis }
         .chartXAxis(.hidden)
@@ -227,25 +225,7 @@ extension MainChartView {
             }
         }
         .id("DummyCobChart")
-        .frame(height: UIScreen.main.bounds.height * 0.08)
-        .frame(width: screenSize.width - 10)
-        .chartXAxis(.hidden)
-        .chartYAxis { cobChartYAxis }
-        .chartLegend(.hidden)
-    }
-
-    private var dummyIobChart: some View {
-        Chart {
-            ForEach(state.enactedAndNonEnactedDeterminations) { iob in
-                let amount = iob.iob?.decimalValue ?? 0
-                let date: Date = iob.deliverAt ?? Date()
-
-                LineMark(x: .value("Time", date), y: .value("Value", amount)).foregroundStyle(.clear)
-                AreaMark(x: .value("Time", date), y: .value("Value", amount)).foregroundStyle(.clear)
-            }
-        }
-        .id("DummyIobChart")
-        .frame(height: UIScreen.main.bounds.height * 0.08)
+        .frame(height: UIScreen.main.bounds.height * 0.1)
         .frame(width: screenSize.width - 10)
         .chartXAxis(.hidden)
         .chartYAxis { cobChartYAxis }
@@ -289,7 +269,7 @@ extension MainChartView {
             .onChange(of: didAppearTrigger) { _ in
                 calculateTTs()
             }
-            .frame(minHeight: UIScreen.main.bounds.height * 0.01)
+            .frame(minHeight: UIScreen.main.bounds.height * 0.2)
             .frame(width: fullWidth(viewWidth: screenSize.width))
             .chartXScale(domain: startMarker ... endMarker)
             .chartXAxis { mainChartXAxis }
@@ -373,29 +353,11 @@ extension MainChartView {
                 AreaMark(x: .value("Time", date), y: .value("Value", amount)).foregroundStyle(Color.orange.gradient.opacity(0.3))
             }
         }
-        .frame(height: UIScreen.main.bounds.height * 0.08)
-        .frame(width: fullWidth(viewWidth: screenSize.width))
-        .chartXScale(domain: startMarker ... endMarker)
-        .chartXAxis { basalChartXAxis }
-        .chartXAxis(.hidden)
-        .chartYAxis(.hidden)
-    }
-
-    private var iobChart: some View {
-        Chart {
-            drawCurrentTimeMarker()
-            ForEach(state.enactedAndNonEnactedDeterminations) { iob in
-                let amount: Decimal = iob.iob?.decimalValue ?? 0
-                let date: Date = iob.deliverAt ?? Date()
-
-                LineMark(x: .value("Time", date), y: .value("Value", amount)).foregroundStyle(Color.insulin.gradient)
-                AreaMark(x: .value("Time", date), y: .value("Value", amount)).foregroundStyle(Color.insulin.gradient.opacity(0.3))
-            }
-        }
-        .frame(height: UIScreen.main.bounds.height * 0.08)
+        .frame(height: UIScreen.main.bounds.height * 0.1)
         .frame(width: fullWidth(viewWidth: screenSize.width))
         .chartXScale(domain: startMarker ... endMarker)
         .chartXAxis { basalChartXAxis }
+//        .chartYAxis { cobChartYAxis }
         .chartYAxis(.hidden)
     }
 

+ 2 - 2
FreeAPS/Sources/Modules/Home/View/HomeRootView.swift

@@ -720,12 +720,12 @@ extension Home {
 
                     mainChart
 
-                    timeInterval.padding(.top, 20).padding(.bottom, 15)
+                    timeInterval.padding(.top, 20).padding(.bottom, 40)
 
                     if let progress = state.bolusProgress {
                         bolusView(geo, progress).padding(.bottom, 10)
                     } else {
-//                        profileView(geo).padding(.bottom, 10)
+                        profileView(geo).padding(.bottom, 10)
                     }
                 }
                 .background(color)