mirror of
https://github.com/VGEAREN/Stockbar.git
synced 2026-10-06 14:33:11 +08:00
v1.1.6: Add high/low prices to chart stats row
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
729b03eb6e
commit
2683521067
@@ -214,11 +214,16 @@ struct StockChartView: View {
|
||||
// 今开:分时第一个点的价格;昨收:API 返回的 preclose
|
||||
|
||||
private var statsRow: some View {
|
||||
HStack(spacing: 0) {
|
||||
let prices = points.map(\.price)
|
||||
return HStack(spacing: 0) {
|
||||
statItem(label: "昨收", value: fmt(preClose))
|
||||
Spacer()
|
||||
statItem(label: "今开", value: fmt(points.first?.price ?? 0))
|
||||
Spacer()
|
||||
statItem(label: "最高", value: fmt(prices.max() ?? 0))
|
||||
Spacer()
|
||||
statItem(label: "最低", value: fmt(prices.min() ?? 0))
|
||||
Spacer()
|
||||
statItem(label: "现价", value: fmt(quote?.price ?? 0))
|
||||
}
|
||||
.padding(.horizontal, 12)
|
||||
|
||||
Reference in New Issue
Block a user