struct ContentView: View {
   @State private var appData = ApplicationData.shared

   var body: some View {
      VStack {
         Chart {
            ForEach(appData.sales) { product in
               ForEach(product.sales) { sale in
                  LineMark(x: .value("Date", sale.date, unit: .day), y: .value("Sales", sale.amount))
               }.foregroundStyle(by: .value("Products", product.name))
            }
         }.frame(height: 300)
         .padding()
         Spacer()
      }
   }
}