Переглянути джерело

Fix chart y-axis label; fix some adjustments

Deniz Cengiz 1 рік тому
батько
коміт
59954ad7c4

+ 1 - 1
Trio/Sources/Localizations/Main/Localizable.xcstrings

@@ -149135,7 +149135,7 @@
     "Tap and hold a bar to reveal more details." : {
 
     },
-    "Tap and hold the AGP graph or Time-in-Range ring for details." : {
+    "Tap and hold the AGP graph or Time-in-Range ring to reveal more details." : {
 
     },
     "Tap and hold the Time-in-Range ring to reveal more details." : {

+ 7 - 4
Trio/Sources/Modules/Stat/View/StatRootView.swift

@@ -96,14 +96,17 @@ extension Stat {
                     var hintText: String {
                         switch state.selectedGlucoseChartType {
                         case .percentile:
-                            String(localized: "Tap and hold the AGP graph or Time-in-Range ring for details.")
+                            String(localized: "Tap and hold the AGP graph or Time-in-Range ring to reveal more details.")
                         case .distribution:
                             String(localized: "Tap and hold the Time-in-Range ring to reveal more details.")
                         }
                     }
-                    Image(systemName: "hand.draw.fill").foregroundStyle(Color.primary)
-                    Text(hintText).foregroundStyle(Color.secondary)
-                    Spacer()
+                    Image(systemName: "hand.draw.fill")
+                        .foregroundStyle(Color.primary)
+                        .padding(.leading)
+                    Text(hintText)
+                        .foregroundStyle(Color.secondary)
+                        .padding(.trailing)
                 }.font(.footnote)
             }
         }

+ 10 - 8
Trio/Sources/Modules/Stat/View/ViewElements/BolusStatsView.swift

@@ -76,8 +76,16 @@ struct BolusStatsView: View {
 
     var body: some View {
         VStack(alignment: .leading, spacing: 8) {
-            statsView
-            chartsView
+            statsView.padding(.bottom)
+
+            VStack(alignment: .trailing) {
+                Text("Bolus Insulin (U)")
+                    .foregroundStyle(.secondary)
+                    .font(.footnote)
+                    .padding(.bottom, 4)
+
+                chartsView
+            }
         }
         .onAppear {
             scrollPosition = StatChartUtils.getInitialScrollPosition(for: selectedDuration)
@@ -172,12 +180,6 @@ struct BolusStatsView: View {
                 }
             }
         }
-        .chartYAxisLabel(alignment: .trailing) {
-            Text("Bolus Insulin (U)")
-                .foregroundStyle(.primary)
-                .font(.footnote)
-                .padding(.vertical, 3)
-        }
         .chartXAxis {
             AxisMarks(preset: .aligned, values: .stride(by: selectedDuration == .Day ? .hour : .day)) { value in
                 if let date = value.as(Date.self) {

+ 9 - 7
Trio/Sources/Modules/Stat/View/ViewElements/MealStatsView.swift

@@ -79,7 +79,15 @@ struct MealStatsView: View {
     var body: some View {
         VStack(alignment: .leading, spacing: 8) {
             statsView.padding(.bottom)
-            chartsView
+
+            VStack(alignment: .trailing) {
+                Text("Macro Nutrients (g)")
+                    .foregroundStyle(.secondary)
+                    .font(.footnote)
+                    .padding(.bottom, 4)
+
+                chartsView
+            }
         }
         .onAppear {
             scrollPosition = StatChartUtils.getInitialScrollPosition(for: selectedDuration)
@@ -181,12 +189,6 @@ struct MealStatsView: View {
                 }
             }
         }
-        .chartYAxisLabel(alignment: .trailing) {
-            Text("Macro Nutrients (g)")
-                .foregroundStyle(.primary)
-                .font(.footnote)
-                .padding(.vertical, 3)
-        }
         .chartXAxis {
             AxisMarks(preset: .aligned, values: .stride(by: selectedDuration == .Day ? .hour : .day)) { value in
                 if let date = value.as(Date.self) {

+ 9 - 7
Trio/Sources/Modules/Stat/View/ViewElements/TotalDailyDoseChart.swift

@@ -54,7 +54,15 @@ struct TotalDailyDoseChart: View {
     var body: some View {
         VStack(alignment: .leading, spacing: 8) {
             statsView.padding(.bottom)
-            chartsView
+
+            VStack(alignment: .trailing) {
+                Text("Total Daily Dose (U)")
+                    .foregroundStyle(.secondary)
+                    .font(.footnote)
+                    .padding(.bottom, 4)
+
+                chartsView
+            }
         }
         .onAppear {
             scrollPosition = StatChartUtils.getInitialScrollPosition(for: selectedDuration)
@@ -166,12 +174,6 @@ struct TotalDailyDoseChart: View {
                 }
             }
         }
-        .chartYAxisLabel(alignment: .trailing) {
-            Text("Total Daily Dose (U)")
-                .foregroundStyle(.primary)
-                .font(.footnote)
-                .padding(.vertical, 3)
-        }
         .chartXAxis {
             AxisMarks(preset: .aligned, values: .stride(by: selectedDuration == .Day ? .hour : .day)) { value in
                 if let date = value.as(Date.self) {