changeset 94:e0c0306fb079

Fix bug color LineChartView on dragGesture
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sun, 06 Jun 2021 18:47:19 +0200
parents 2932cb8bcee3
children 468e6857c4ce 552685d27cbe
files Sources/StockCharts/LineChart/Helpers/LineView.swift StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/Sources/StockCharts/LineChart/Helpers/LineView.swift	Sun Jun 06 18:11:05 2021 +0200
+++ b/Sources/StockCharts/LineChart/Helpers/LineView.swift	Sun Jun 06 18:47:19 2021 +0200
@@ -60,14 +60,13 @@
     public func colorLine() -> Color {
         var color = Color(.systemGreen)
         
-        if data.first! > data.last! {
+        if showingIndicators {
+            color = Color(.systemBlue)
+        } else if data.first! > data.last! {
             color = Color(.systemRed)
         } else if data.first! == data.last! {
             color = Color(.systemTeal)
         }
-        else if showingIndicators {
-            color = Color(.systemBlue)
-        }
         
         return color
     }
Binary file StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed