You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if you could add an example on how to access time stamp and values most effectively.
I came up with the following setup
var dataPoints = [DataPoint]()
do {
try records?.forEach {
if let time = $0.values["_time"] as? Date, let values = $0.values["_value"] as? Double {
dataPoints.append(DataPoint(date: time, value: values))
}
}
} catch {
print (error)
}
to fill DataPoint to be used in SwiftUI Charts.
struct DataPoint: Identifiable {
var date: Date
var value: Double
var id = UUID()
}
Maybe this could be done more elegantly. It would great to have your thoughts.
The text was updated successfully, but these errors were encountered:
It would be great if you could add an example on how to access time stamp and values most effectively.
I came up with the following setup
to fill DataPoint to be used in SwiftUI Charts.
Maybe this could be done more elegantly. It would great to have your thoughts.
The text was updated successfully, but these errors were encountered: