modify LineChartView rateValue set code (#200)

This commit is contained in:
Suyeong Pi
2021-08-12 05:06:11 +09:00
committed by GitHub
parent aecfdc5634
commit a4381e037c
@@ -38,7 +38,7 @@ public struct LineChartView: View {
legend: String? = nil,
style: ChartStyle = Styles.lineChartStyleOne,
form: CGSize? = ChartForm.medium,
rateValue: Int? = 14,
rateValue: Int?,
dropShadow: Bool? = true,
valueSpecifier: String? = "%.1f") {
@@ -74,14 +74,14 @@ public struct LineChartView: View {
}
HStack {
if (self.rateValue ?? 0 != 0)
if let rateValue = self.rateValue
{
if (self.rateValue ?? 0 >= 0){
if (rateValue ?? 0 >= 0){
Image(systemName: "arrow.up")
}else{
Image(systemName: "arrow.down")
}
Text("\(self.rateValue!)%")
Text("\(rateValue!)%")
}
}
}