# HG changeset patch # User Dennis C. M. # Date 1620494132 -7200 # Node ID 21fa5c3ef5adfc9fb702b7a65e0d9f014bef1522 # Parent 2b23d1f2d2d922d41718e2be0621fffc3b894c5c# Parent b0eddc3865353a8017eced170fa49f3996ec1ef1 Merge pull request #6 from denniscm190/lazybear-tests Lazybear tests committer: GitHub diff -r 2b23d1f2d2d9 -r 21fa5c3ef5ad Sources/StockCharts/LineChart/Helpers/LinePath.swift --- a/Sources/StockCharts/LineChart/Helpers/LinePath.swift Sat May 08 18:07:43 2021 +0200 +++ b/Sources/StockCharts/LineChart/Helpers/LinePath.swift Sat May 08 19:15:32 2021 +0200 @@ -15,6 +15,7 @@ public func path(in rect: CGRect) -> Path { var path = Path() + var pathPoints = [CGPoint]() let normalizedData = normalize(data) let widthBetweenDataPoints = Double(width) / Double(normalizedData.count - 1) // Remove first point @@ -33,6 +34,10 @@ pathPoints.append(path.currentPoint!) } + DispatchQueue.main.async { + self.pathPoints = pathPoints + } + return path } diff -r 2b23d1f2d2d9 -r 21fa5c3ef5ad Sources/StockCharts/LineChart/LineChartView.swift --- a/Sources/StockCharts/LineChart/LineChartView.swift Sat May 08 18:07:43 2021 +0200 +++ b/Sources/StockCharts/LineChart/LineChartView.swift Sat May 08 19:15:32 2021 +0200 @@ -25,9 +25,11 @@ public var body: some View { VStack { - ChartLabel(data: data, dates: dates, hours: hours, indexPosition: $indexPosition) - .opacity(showingIndicators ? 1: 0) - .padding(.vertical) + if dragGesture ?? true { + ChartLabel(data: data, dates: dates, hours: hours, indexPosition: $indexPosition) + .opacity(showingIndicators ? 1: 0) + .padding(.vertical) + } LineView(data: data, dates: dates, hours: hours, dragGesture: dragGesture, showingIndicators: $showingIndicators, indexPosition: $indexPosition) } diff -r 2b23d1f2d2d9 -r 21fa5c3ef5ad StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate Binary file StockCharts.xcodeproj/project.xcworkspace/xcuserdata/dennis.xcuserdatad/UserInterfaceState.xcuserstate has changed