Mercurial > public > stock-charts
comparison Sources/StockCharts/LineChart/Helpers/LinePath.swift @ 73:cc59a30661f7
Fixing: Modifying state during view update
author | Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com> |
---|---|
date | Sat, 08 May 2021 19:07:57 +0200 |
parents | 552963ee4dc4 |
children | cda2b6a398a7 |
comparison
equal
deleted
inserted
replaced
72:552963ee4dc4 | 73:cc59a30661f7 |
---|---|
29 let y = y * Double(height) | 29 let y = y * Double(height) |
30 path.addLine(to: CGPoint(x: x, y: y)) | 30 path.addLine(to: CGPoint(x: x, y: y)) |
31 } | 31 } |
32 | 32 |
33 // Append current point to an array. Later will be used for Drag Gesture | 33 // Append current point to an array. Later will be used for Drag Gesture |
34 DispatchQueue.main.async { | 34 pathPoints.append(path.currentPoint!) |
35 pathPoints.append(path.currentPoint!) | 35 } |
36 } | 36 |
37 DispatchQueue.main.async { | |
38 self.pathPoints = pathPoints | |
37 } | 39 } |
38 | 40 |
39 return path | 41 return path |
40 } | 42 } |
41 | |
42 // public func test | |
43 | 43 |
44 /* | 44 /* |
45 Get data -> normalize it -> 0 <= output <= 1 | 45 Get data -> normalize it -> 0 <= output <= 1 |
46 */ | 46 */ |
47 public func normalize(_ data: [Double]) -> [Double] { | 47 public func normalize(_ data: [Double]) -> [Double] { |