Mercurial > public > stock-charts
diff InteractiveCharts/LineChart/Helpers/LinePath.swift @ 8:959175ee5ebd
Implement interaction with ChartView
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Mon, 26 Apr 2021 23:06:42 +0200 |
parents | f828c7c408d4 |
children |
line wrap: on
line diff
--- a/InteractiveCharts/LineChart/Helpers/LinePath.swift Mon Apr 26 23:06:25 2021 +0200 +++ b/InteractiveCharts/LineChart/Helpers/LinePath.swift Mon Apr 26 23:06:42 2021 +0200 @@ -10,6 +10,7 @@ struct LinePath: Shape { var data: [Double] var (width, height): (CGFloat, CGFloat) + @Binding var pathPoints: [CGPoint] func path(in rect: CGRect) -> Path { var path = Path() @@ -19,8 +20,6 @@ let initialPoint = normalizedData[0] * Double(height) var x: Double = 0 - var pathPoints = [CGPoint]() - path.move(to: CGPoint(x: x, y: initialPoint)) for y in normalizedData { if normalizedData.firstIndex(of: y) != 0 { // Skip first point