Mercurial > public > lazybear
diff LazyBear/Views/Company/Helpers/ChartHelper.swift @ 444:428109b1e3f0
InsiderTransactions implemented
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Tue, 22 Jun 2021 16:54:21 +0200 |
parents | 417148200aaf |
children |
line wrap: on
line diff
--- a/LazyBear/Views/Company/Helpers/ChartHelper.swift Mon Jun 21 20:17:46 2021 +0200 +++ b/LazyBear/Views/Company/Helpers/ChartHelper.swift Tue Jun 22 16:54:21 2021 +0200 @@ -17,19 +17,26 @@ .overlay( VStack { if let quote = company.data.quote?.first { - HStack(alignment: .center) { - Text("\(quote.latestPrice ?? 0, specifier: "%.2f")") - .foregroundColor(quote.changePercent ?? 0 < 0 ? .red: .green) - .fontWeight(.semibold) + Text("\(quote.latestPrice ?? 0, specifier: "%.2f")") + .font(.title2) + .fontWeight(.semibold) + .foregroundColor(quote.changePercent ?? 0 < 0 ? .red: .green) + .padding(.top) + HStack { Text("\(quote.changePercent ?? 0 * 100, specifier: "%.2f")%") .foregroundColor(quote.changePercent ?? 0 < 0 ? .red: .green) - .font(.callout) + .font(.caption) .fontWeight(.semibold) - Spacer() + Text("1 day") + .font(.caption) + .opacity(0.5) } - .padding() + .padding(.horizontal) + + Spacer() + if let historicalPrices = company.data.historicalPrices { let prices = historicalPrices.compactMap { $0.close }