comparison Sources/StockCharts/LineChart/Helpers/LinePath.swift @ 72:552963ee4dc4

Fixing: Modifying state during view update
author Dennis Concepción Martín <66180929+denniscm190@users.noreply.github.com>
date Sat, 08 May 2021 19:06:00 +0200
parents c37c93ba3f37
children cc59a30661f7
comparison
equal deleted inserted replaced
71:c37c93ba3f37 72:552963ee4dc4
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 pathPoints.append(path.currentPoint!) 34 DispatchQueue.main.async {
35 pathPoints.append(path.currentPoint!)
36 }
35 } 37 }
36
37 self.pathPoints = pathPoints
38 38
39 return path 39 return path
40 } 40 }
41
42 // public func test
41 43
42 /* 44 /*
43 Get data -> normalize it -> 0 <= output <= 1 45 Get data -> normalize it -> 0 <= output <= 1
44 */ 46 */
45 public func normalize(_ data: [Double]) -> [Double] { 47 public func normalize(_ data: [Double]) -> [Double] {