Showing 2 changed files with 16 additions and 3 deletions
+12 -1
USB Meter/Views/Meter/Components/MeasurementChartView.swift
@@ -98,9 +98,20 @@ struct MeasurementChartView: View {
98 98
         return isLargeDisplay ? 36 : 28
99 99
     }
100 100
 
101
+    private var isPortraitLayout: Bool {
102
+        guard availableSize != .zero else { return verticalSizeClass != .compact }
103
+        return availableSize.height >= availableSize.width
104
+    }
105
+
101 106
     private var plotSectionHeight: CGFloat {
102 107
         if availableSize == .zero {
103
-            return compactLayout ? 260 : 340
108
+            return compactLayout ? 300 : 380
109
+        }
110
+
111
+        if isPortraitLayout {
112
+            // Keep the rendered plot area (plot section minus X axis) above half of the display height.
113
+            let minimumPlotHeight = max(availableSize.height * 0.52, compactLayout ? 250 : 320)
114
+            return minimumPlotHeight + xAxisHeight
104 115
         }
105 116
 
106 117
         if compactLayout {
+4 -2
USB Meter/Views/Meter/Tabs/Chart/MeterChartTabView.swift
@@ -13,7 +13,8 @@ struct MeterChartTabView: View {
13 13
 
14 14
     private let pageHorizontalPadding: CGFloat = 12
15 15
     private let pageVerticalPadding: CGFloat = 12
16
-    private let contentCardPadding: CGFloat = 16
16
+    private let portraitContentCardHorizontalPadding: CGFloat = 8
17
+    private let portraitContentCardVerticalPadding: CGFloat = 12
17 18
 
18 19
     private var prefersCompactPortraitLayout: Bool {
19 20
         size.height < 760 || size.width < 380
@@ -44,7 +45,8 @@ struct MeterChartTabView: View {
44 45
                         availableSize: size
45 46
                     )
46 47
                         .environmentObject(meter.measurements)
47
-                        .padding(contentCardPadding)
48
+                        .padding(.horizontal, portraitContentCardHorizontalPadding)
49
+                        .padding(.vertical, portraitContentCardVerticalPadding)
48 50
                         .meterCard(tint: meter.color, fillOpacity: 0.12, strokeOpacity: 0.20)
49 51
                 }
50 52
             }