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

Lower x-axis tick mark thresholds for display

Deniz Cengiz 1 год назад
Родитель
Сommit
4d7521dc4e

+ 3 - 3
Trio/Sources/Modules/Stat/View/ViewElements/Insulin/BolusStatsView.swift

@@ -194,14 +194,14 @@ struct BolusStatsView: View {
                             AxisGridLine()
                         }
                     case .Month:
-                        if day % 5 == 0 { // Only show every 5th day
+                        if day % 3 == 0 { // Only show every 3rd day
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()
                         }
                     case .Total:
-                        // Only show January, April, July, October
-                        if day == 1 && Calendar.current.component(.month, from: date) % 3 == 1 {
+                        // Only show every other month
+                        if day == 1 && Calendar.current.component(.month, from: date) % 2 == 1 {
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()

+ 4 - 3
Trio/Sources/Modules/Stat/View/ViewElements/Insulin/TotalDailyDoseChart.swift

@@ -182,19 +182,20 @@ struct TotalDailyDoseChart: View {
 
                     switch selectedDuration {
                     case .Day:
-                        if hour % 6 == 0 {
+                        if hour % 6 == 0 { // Show only every 6 hours
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()
                         }
                     case .Month:
-                        if day % 5 == 0 {
+                        if day % 3 == 0 { // Only show every 3rd day
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()
                         }
                     case .Total:
-                        if day == 1 && Calendar.current.component(.month, from: date) % 3 == 1 {
+                        // Only show every other month
+                        if day == 1 && Calendar.current.component(.month, from: date) % 2 == 1 {
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()

+ 4 - 3
Trio/Sources/Modules/Stat/View/ViewElements/Meal/MealStatsView.swift

@@ -197,19 +197,20 @@ struct MealStatsView: View {
 
                     switch selectedDuration {
                     case .Day:
-                        if hour % 6 == 0 {
+                        if hour % 6 == 0 { // Show only every 6 hours
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()
                         }
                     case .Month:
-                        if day % 5 == 0 {
+                        if day % 3 == 0 { // Only show every 3rd day
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()
                         }
                     case .Total:
-                        if day == 1 && Calendar.current.component(.month, from: date) % 3 == 1 {
+                        // Only show every other month
+                        if day == 1 && Calendar.current.component(.month, from: date) % 2 == 1 {
                             AxisValueLabel(format: StatChartUtils.dateFormat(for: selectedDuration), centered: true)
                                 .font(.footnote)
                             AxisGridLine()