Skip to content

Commit eca6eda

Browse files
authored
Bugfix: Line height in LineView (AppPear#175)
* Make the line reach the top and bottom of the chart. * Put the Magnifier's bottom edge on the 0 line.
1 parent 1f4949a commit eca6eda

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Sources/SwiftUICharts/LineChart/LineView.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@ public struct LineView: View {
6565
.animation(Animation.easeOut(duration: 1).delay(1))
6666
}
6767
Line(data: self.data,
68-
frame: .constant(CGRect(x: 0, y: 0, width: reader.frame(in: .local).width - 30, height: reader.frame(in: .local).height)),
68+
frame: .constant(CGRect(x: 0, y: 0, width: reader.frame(in: .local).width - 30, height: reader.frame(in: .local).height + 25)),
6969
touchLocation: self.$indicatorLocation,
7070
showIndicator: self.$hideHorizontalLines,
7171
minDataValue: .constant(nil),
7272
maxDataValue: .constant(nil),
7373
showBackground: false,
7474
gradient: self.style.gradientColor
7575
)
76-
.offset(x: 30, y: -20)
76+
.offset(x: 30, y: 0)
7777
.onAppear(){
7878
self.showLegend = true
7979
}

Sources/SwiftUICharts/LineChart/MagnifierRect.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ public struct MagnifierRect: View {
2929
.blendMode(.multiply)
3030
}
3131
}
32+
.offset(x: 0, y: -15)
3233
}
3334
}

0 commit comments

Comments
 (0)