SwiftSunburstDiagram
SwiftSunburstDiagram copied to clipboard
Use in SwiftUI View
Hi,
guess I am doing something wrong... Running this code on a view which is opened as sheet crashes the app.
import SwiftUI
import SunburstDiagram
struct MealBuilderView: View {
var body: some View {
let configuration = SunburstConfiguration(nodes: [
Node(name: "Walking",
showName: false,
value: 10.0,
backgroundColor: .systemBlue),
Node(name: "Restaurant",
showName: false,
value: 30.0,
backgroundColor: .systemRed),
Node(name: "Home",
showName: false,
value: 75.0,
backgroundColor: .systemTeal)
])
return SunburstView(configuration: configuration)
}
}
```