Post

Replies

Boosts

Views

Activity

Half Donut Chart using SectorMark
Does anyone knows if it is possible to make a half donut chart using the new one SectorMark? I am exploring the initializers but so far no luck, this is my code like anyone else making a normal donut: struct Score: Identifiable { let id = UUID() let type: String let value: Int } @State private var scores: [Score] = [ .init(type: "Hits", value: 1), .init(type: "Misses", value: 9) ] Chart(scores) { score in SectorMark( angle: .value("Values", score.value), innerRadius: .ratio(0.9), outerRadius: .ratio(0.7) ) .foregroundStyle( by: .value("Type", score.type) ) }
2
0
987
Mar ’24