When using charts framework to make a Bar Chart after creating my fake data and creating the chart in the contentView no x or y axis contents appeared I was following a tutorial and they appeared with him any one can help
Bar Chart
import SwiftUI import Charts
struct Items : Identifiable {
var id = UUID()
let type : String
let value : Double
}
struct ContentView: View {
let items : [Items] = [
Items(type: "Medical", value: 10000),
Items(type: "Engeneering", value: 5000),
Items(type: "singing", value: 15000),
Items(type: "pilot", value: 1000),
Items(type: "athlete", value: 18000),
]
![]("https://developer.apple.com/forums/content/attachment/73dd58fb-2753-4d65-be30-ad4ae7ebb1be" "title=Screen Shot 2023-07-10 at 6.19.04 AM.png;width=854;height=1598")
var body: some View {
NavigationView{
ScrollView{
Chart(items){item in
BarMark( x: .value("Job", item.type),
y: .value("salary", item.value)
)
.foregroundStyle(.brown)
.cornerRadius(10)
}
.frame(height: 200)
.padding()
}
.navigationTitle("Charts")
}
}