Mercurial > public > stock-charts
diff Sources/StockCharts/LineChart/Helpers/LineView.swift @ 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 | e16e6bdaa31d |
children | 766a1169564b |
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 }