浏览代码

position for carbs, fpus for mmol/l, to do: bolus position, adjust limits also for mmol/L

polscm32 2 年之前
父节点
当前提交
ee18e8963c
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

+ 6 - 2
FreeAPS/Sources/Modules/Home/View/Chart/MainChartView.swift

@@ -189,9 +189,11 @@ extension MainChartView {
                 /// carbs
                 ForEach(ChartCarbs, id: \.self) { carb in
                     let carbAmount = carb.amount
+                    let yPosition = units == .mgdL ? 60 : 3.33
+                    
                     PointMark(
                         x: .value("Time", carb.timestamp, unit: .second),
-                        y: .value("Value", 60)
+                        y: .value("Value", yPosition)
                     )
                     .symbolSize((Config.carbsSize + CGFloat(carbAmount) * Config.carbsScale) * 10)
                     .foregroundStyle(Color.orange)
@@ -203,9 +205,11 @@ extension MainChartView {
                 ForEach(ChartFpus, id: \.self) { fpu in
                     let fpuAmount = fpu.amount
                     let size = (Config.fpuSize + CGFloat(fpuAmount) * Config.carbsScale) * 1.8
+                    let yPosition = units == .mgdL ? 60 : 3.33
+                    
                     PointMark(
                         x: .value("Time", fpu.timestamp, unit: .second),
-                        y: .value("Value", 60)
+                        y: .value("Value", yPosition)
                     )
                     .symbolSize(size)
                     .foregroundStyle(Color.brown)