fix: add a sensor value to the chart in the popup view even if the popup is closed

This commit is contained in:
Serhiy Mytrovtsiy
2022-03-11 19:02:40 +01:00
parent c8904a27c5
commit fa266ffc32
2 changed files with 12 additions and 3 deletions

View File

@@ -97,11 +97,11 @@ public class LineChartView: NSView {
underLinePath.fill()
}
public func addValue(_ value: Double) {
public func addValue(_ value: Double, redraw: Bool = true) {
self.points.remove(at: 0)
self.points.append(value)
if self.window?.isVisible ?? true {
if redraw && self.window?.isVisible ?? true {
self.display()
}
}