|
|
@@ -319,11 +319,14 @@ struct MainChartView: View {
|
|
|
return ZStack {
|
|
|
Path { path in
|
|
|
for hour in 0 ..< hours + hours {
|
|
|
- let x = firstHourPosition(viewWidth: fullSize.width) +
|
|
|
- oneSecondStep(viewWidth: fullSize.width) *
|
|
|
- CGFloat(hour) * CGFloat(1.hours.timeInterval)
|
|
|
- path.move(to: CGPoint(x: x, y: 0))
|
|
|
- path.addLine(to: CGPoint(x: x, y: fullSize.height - 20))
|
|
|
+ if screenHours < 12 || hour % 2 == 0 {
|
|
|
+ // only show every second line if screenHours is too big
|
|
|
+ let x = firstHourPosition(viewWidth: fullSize.width) +
|
|
|
+ oneSecondStep(viewWidth: fullSize.width) *
|
|
|
+ CGFloat(hour) * CGFloat(1.hours.timeInterval)
|
|
|
+ path.move(to: CGPoint(x: x, y: 0))
|
|
|
+ path.addLine(to: CGPoint(x: x, y: fullSize.height - 20))
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
.stroke(useColour, lineWidth: 0.15)
|
|
|
@@ -339,7 +342,6 @@ struct MainChartView: View {
|
|
|
)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
// MARK: TO DO: CHANGE TIME LABELS TO ONLY DISPLAY EVERY SECOND LABEL WHEN SCREENHOURS IS TOO BIG
|
|
|
|
|
|
// private func timeLabelsView(fullSize: CGSize) -> some View {
|