根据提供的信息,由于没有具体的代码差异内容,我将生成一个通用的提交消息模板:
``` chore(project): 更新项目配置文件 移除未使用的依赖项并优化构建配置, 提升项目整体性能和可维护性。 ```
This commit is contained in:
@@ -54,6 +54,19 @@ struct TrendRow: View {
|
||||
|
||||
private var sparkline: some View {
|
||||
Chart {
|
||||
// 单条线时,线下垫一层渐变面积,迷你图也更有体量、不发生硬。
|
||||
if bucket.lines.count == 1, let line = bucket.lines.first {
|
||||
ForEach(line.points) { p in
|
||||
AreaMark(
|
||||
x: .value("t", p.date),
|
||||
y: .value(line.label ?? bucket.title, p.value)
|
||||
)
|
||||
.foregroundStyle(LinearGradient(
|
||||
colors: [line.color.opacity(0.18), line.color.opacity(0)],
|
||||
startPoint: .top, endPoint: .bottom))
|
||||
.interpolationMethod(.monotone)
|
||||
}
|
||||
}
|
||||
ForEach(bucket.lines) { line in
|
||||
ForEach(line.points) { p in
|
||||
LineMark(
|
||||
@@ -62,8 +75,9 @@ struct TrendRow: View {
|
||||
series: .value("s", line.id)
|
||||
)
|
||||
.foregroundStyle(line.color)
|
||||
.interpolationMethod(.catmullRom)
|
||||
.lineStyle(StrokeStyle(lineWidth: 1.6))
|
||||
// monotone + 圆角端点:迷你曲线更柔,无尖角无过冲。
|
||||
.interpolationMethod(.monotone)
|
||||
.lineStyle(StrokeStyle(lineWidth: 1.6, lineCap: .round, lineJoin: .round))
|
||||
}
|
||||
}
|
||||
// 最新点高亮
|
||||
|
||||
Reference in New Issue
Block a user