fix(charts): 将复合图数据曲线统一为平滑实线
This commit is contained in:
@@ -201,8 +201,7 @@ private struct PanelCurveCanvas: View, Animatable {
|
||||
guard let first = targetBegin, let last = targetEnd else { return }
|
||||
let domain = PanelCurveFrame.domain(previousBegin: previousBegin, previousEnd: previousEnd,
|
||||
begin: first, end: last, progress: Double(progress))
|
||||
for (seriesIndex, entry) in zip(frame.series, colors).enumerated() {
|
||||
let (values, tint) = entry
|
||||
for (values, tint) in zip(frame.series, colors) {
|
||||
for run in PanelCurveGeometry.runs(dates: frame.dates, values: values, maximumGap: maximumGap, boundaryDates: frame.boundaryDates, intervals: frame.intervals) {
|
||||
let points = run.map { item in
|
||||
CGPoint(x: size.width * domain.position(item.date),
|
||||
@@ -221,7 +220,7 @@ private struct PanelCurveCanvas: View, Animatable {
|
||||
var area = line
|
||||
area.addLine(to: CGPoint(x: finish.x, y: size.height)); area.addLine(to: CGPoint(x: start.x, y: size.height)); area.closeSubpath()
|
||||
context.fill(area, with: .linearGradient(Gradient(colors: [tint.opacity(0.20), tint.opacity(0.01)]), startPoint: .zero, endPoint: CGPoint(x: 0, y: size.height)))
|
||||
context.stroke(line, with: .color(tint), style: StrokeStyle(lineWidth: 1.5, lineCap: .round, lineJoin: .round, dash: seriesIndex == 1 ? [4, 2] : seriesIndex == 2 ? [1, 2] : []))
|
||||
context.stroke(line, with: .color(tint), style: StrokeStyle(lineWidth: 1.5, lineCap: .round, lineJoin: .round))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user