feat(ui): 趋势图跳过无值节点并接续有效数据

This commit is contained in:
2026-11-07 15:04:06 +08:00
parent 050ee30f56
commit 7f3f573e7c
16 changed files with 70 additions and 16 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ struct MiniTrendChart: View {
run.removeAll(keepingCapacity: true)
}
for (index, value) in values.enumerated() {
guard let value, value.isFinite else { appendRun(); continue }
guard let value, value.isFinite else { continue }
let x = size.width * CGFloat(index + MetricHistory.capacity - values.count) / CGFloat(MetricHistory.capacity - 1)
run.append(CGPoint(x: x, y: 2 + (size.height - 4) * (1 - min(1, max(0, value)))))
}