fix: render sparkline with a single data point (flat line)

This commit is contained in:
SuperDooper
2026-05-08 09:34:38 +02:00
parent f17694622c
commit f2f2be1305
+4 -1
View File
@@ -429,7 +429,9 @@ struct SparklineView: View {
var body: some View {
GeometryReader { geo in
if data.count > 1 {
let plotData = data.count == 1 ? [data[0], data[0]] : data
if plotData.count > 1 {
let data = plotData
let w = geo.size.width
let h = geo.size.height
let minV = data.min() ?? 0
@@ -1170,3 +1172,4 @@ struct UpdateSheet: View {
}
}