Trying to create a Chart in ContentView. I keep seeing this error no matter how I try to construct it.
import Foundation
import SwiftUI
import Charts
struct StockView: View {
var body: some View {
Chart {
BarMark(
x: .value("Department", "Finance"),
y: .value("Profit", 300000)
)
}
}
}
#Preview {
StockView()
}
Static method 'buildExpression' requires that 'Chart' conform to 'View'