Mercurial > public > stock-charts
comparison Sources/StockCharts/LineChart/Helpers/ChartLabel.swift @ 103:766a1169564b
Add WatchOS compatability
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 27 Jun 2021 16:32:23 +0200 |
parents | ffc7731f7206 |
children | 0c0d38dca6d8 |
comparison
equal
deleted
inserted
replaced
102:7e524a9cc194 | 103:766a1169564b |
---|---|
25 if let hours = self.hours { | 25 if let hours = self.hours { |
26 let hour = hours[indexPosition] | 26 let hour = hours[indexPosition] |
27 Text(hour) | 27 Text(hour) |
28 .opacity(0.5) | 28 .opacity(0.5) |
29 } | 29 } |
30 | |
31 #if os(iOS) | |
30 Text("\(data[indexPosition], specifier: "%.2f")") | 32 Text("\(data[indexPosition], specifier: "%.2f")") |
31 .foregroundColor(Color(.systemBlue)) | 33 .foregroundColor(Color(.systemBlue)) |
34 | |
35 #elseif os(watchOS) | |
36 Text("\(data[indexPosition], specifier: "%.2f")") | |
37 .foregroundColor(Color(.blue)) | |
38 #endif | |
39 | |
32 } | 40 } |
33 .font(.caption) | 41 .font(.caption) |
34 } | 42 } |
35 } | 43 } |
36 | 44 |