Parcourir la source

preliminary fix for y axis scaling issue with dummy chart

polscm32 aka Marvout il y a 1 an
Parent
commit
671df1a5a2
1 fichiers modifiés avec 15 ajouts et 1 suppressions
  1. 15 1
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

+ 15 - 1
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -115,7 +115,10 @@ struct MainChartView: View {
     var body: some View {
         VStack {
             ZStack {
-                staticYAxisChart
+                VStack {
+                    staticYAxisChart
+                    dummyBasalChart
+                }
 
                 ScrollViewReader { scroller in
                     ScrollView(.horizontal, showsIndicators: false) {
@@ -196,6 +199,17 @@ extension MainChartView {
         .chartLegend(.hidden)
     }
 
+    private var dummyBasalChart: some View {
+        Chart {}
+            .id("DummyBasalChart")
+            .frame(height: UIScreen.main.bounds.height * 0.08)
+            .frame(width: screenSize.width - 10)
+            .chartYAxis(.hidden)
+            .chartXAxis(.hidden)
+            .chartYScale(domain: minValue ... maxValue)
+            .chartLegend(.hidden)
+    }
+
     private var mainChart: some View {
         VStack {
             Chart {