polscm32 2 лет назад
Родитель
Сommit
d925233aff

+ 1 - 1
FreeAPS.xcworkspace/xcshareddata/swiftpm/Package.resolved

@@ -30,7 +30,7 @@
       },
       {
         "package": "SwiftCharts",
-        "repositoryURL": "https://github.com/ivanschuetz/SwiftCharts",
+        "repositoryURL": "https://github.com/ivanschuetz/SwiftCharts.git",
         "state": {
           "branch": "master",
           "revision": "c354c1945bb35a1f01b665b22474f6db28cba4a2",

+ 48 - 38
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView2.swift

@@ -430,52 +430,62 @@ extension MainChartView2 {
                     } else {
                         AxisGridLine(stroke: .init(lineWidth: 0, dash: [2, 3]))
                     }
-                    AxisTick(length: 30, stroke: .init(lineWidth: 4))
-                        .foregroundStyle(Color.clear)
+                    AxisTick(length: 4, stroke: .init(lineWidth: 4))
+                        .foregroundStyle(Color.gray)
+                    AxisValueLabel()
                 }
             }
         }
     }
 
     private func Legend() -> some View {
-        HStack {
-            Image(systemName: "line.diagonal")
-                .rotationEffect(Angle(degrees: 45))
-                .foregroundColor(.green)
-            Text("BG")
-                .foregroundColor(.secondary)
-            Spacer()
-            Image(systemName: "line.diagonal")
-                .rotationEffect(Angle(degrees: 45))
-                .foregroundColor(.insulin)
-            Text("IOB")
-                .foregroundColor(.secondary)
-            Spacer()
-            Image(systemName: "line.diagonal")
-                .rotationEffect(Angle(degrees: 45))
-                .foregroundColor(.purple)
-            Text("ZT")
-                .foregroundColor(.secondary)
-            Spacer()
-            Image(systemName: "line.diagonal")
-                .frame(height: 10)
-                .rotationEffect(Angle(degrees: 45))
-                .foregroundColor(.loopYellow)
-            Text("COB")
-                .foregroundColor(.secondary)
-            Spacer()
-            Image(systemName: "line.diagonal")
-                .rotationEffect(Angle(degrees: 45))
-                .foregroundColor(.orange)
-            Text("UAM")
-                .foregroundColor(.secondary)
-            if eventualBG != nil {
-                Text("⇢ " + String(eventualBG ?? 0))
+        ZStack {
+            Capsule(style: .circular).foregroundStyle(.gray.opacity(0.1)).padding(.horizontal, 30)
+
+            HStack {
+                Image(systemName: "line.diagonal")
+                    .fontWeight(.bold)
+                    .rotationEffect(Angle(degrees: 45))
+                    .foregroundColor(.green)
+                Text("BG")
+                    .foregroundColor(.secondary)
+                Spacer()
+                Image(systemName: "line.diagonal")
+                    .fontWeight(.bold)
+                    .rotationEffect(Angle(degrees: 45))
+                    .foregroundColor(.insulin)
+                Text("IOB")
+                    .foregroundColor(.secondary)
+                Spacer()
+                Image(systemName: "line.diagonal")
+                    .fontWeight(.bold)
+                    .rotationEffect(Angle(degrees: 45))
+                    .foregroundColor(.purple)
+                Text("ZT")
+                    .foregroundColor(.secondary)
+                Spacer()
+                Image(systemName: "line.diagonal")
+                    .fontWeight(.bold)
+                    .frame(height: 10)
+                    .rotationEffect(Angle(degrees: 45))
+                    .foregroundColor(.loopYellow)
+                Text("COB")
+                    .foregroundColor(.secondary)
+                Spacer()
+                Image(systemName: "line.diagonal")
+                    .fontWeight(.bold)
+                    .rotationEffect(Angle(degrees: 45))
+                    .foregroundColor(.orange)
+                Text("UAM")
+                    .foregroundColor(.secondary)
+                if eventualBG != nil {
+                    Text("⇢ " + String(eventualBG ?? 0))
+                }
             }
+            .font(.caption2)
+            .padding(.horizontal, 40)
+            .padding(.vertical, 1)
         }
-        .font(.caption2)
-        .padding(.horizontal, 40)
-        .padding(.vertical, 1)
     }
 }