changeset 96:552685d27cbe 1.2.2

Merge pull request #10 from denniscm190/dennis Fix bug color LineChartView on dragGesture committer: GitHub <noreply@github.com>
author Dennis C. M. <dennis@denniscm.com>
date Sun, 06 Jun 2021 18:51:59 +0200
parents 2932cb8bcee3 (current diff) e0c0306fb079 (diff)
children 7601dfc0d1f5
files
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:51:59 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