They most likely used a foregroundStyle with a linearGradient.
An example would be similar to (assuming the charts left legend are these numbers, and the max is 11, the min is 8)
let blueLocation: Double = 1 - ((11 - 9) / (11 - 8))
let yellowLocation: Double = 1 - ((11 - 10) / (11 - 8))
LineMark(x: .., y: ..).foregroundStyle(.linearGradient(stops:
[.init(color: .blue, location 0.0), .init(color: .blue, location: blueLocation), .init(color: .yellow, location: blueLocation+.0001), ....
])
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: