Skip to content

Commit

Permalink
Make LineChartView compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
niklassaers committed Nov 26, 2021
1 parent 102b51b commit edd7ae1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/SwiftUICharts/LineChart/LineChartView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ public struct LineChartView: View {

if let rateValue = self.rateValue
{
if (rateValue ?? 0 >= 0){
if (rateValue >= 0){
Image(systemName: "arrow.up")
}else{
Image(systemName: "arrow.down")
}
Text("\(rateValue!)%")
Text("\(rateValue)%")
}
}
}
Expand Down Expand Up @@ -142,10 +142,10 @@ public struct LineChartView: View {
struct WidgetView_Previews: PreviewProvider {
static var previews: some View {
Group {
LineChartView(data: [8,23,54,32,12,37,7,23,43], title: "Line chart", legend: "Basic")
LineChartView(data: [8,23,54,32,12,37,7,23,43], title: "Line chart", legend: "Basic", rateValue: 1)
.environment(\.colorScheme, .light)

LineChartView(data: [282.502, 284.495, 283.51, 285.019, 285.197, 286.118, 288.737, 288.455, 289.391, 287.691, 285.878, 286.46, 286.252, 284.652, 284.129, 284.188], title: "Line chart", legend: "Basic")
LineChartView(data: [282.502, 284.495, 283.51, 285.019, 285.197, 286.118, 288.737, 288.455, 289.391, 287.691, 285.878, 286.46, 286.252, 284.652, 284.129, 284.188], title: "Line chart", legend: "Basic", rateValue: 1)
.environment(\.colorScheme, .light)
}
}
Expand Down

0 comments on commit edd7ae1

Please sign in to comment.