struct ContentView: View {
   @State private var appData = ApplicationData.shared
   @State private var selectedFood: String? = nil

   var body: some View {
      VStack {
         Chart(appData.listOfItems) { item in
            BarMark(x: .value("Name", item.name), y: .value("Calories", item.calories))
               .foregroundStyle(item.name == selectedFood ? .yellow : .blue)
         }
         .frame(height: 300)
         .padding()
         .chartXSelection(value: $selectedFood)
         Spacer()
      }
   }
}