feat(ui): 趋势图跳过无值节点并接续有效数据
This commit is contained in:
@@ -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)))))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user