title: Core Data @FetchRequest SwiftUI
body: <blockquote>
    <p>I am trying to use a fetch request in a SwiftUI Charts package/CocoaPod. My issue is that when I use a ForEach to iterate over the Attribute (ACFTScores.totalScore) it populates one value per chart... I know this is because the BarChart is in the body of the ForEach but I don't know how to grab the range of the fetch and make it work with the SwiftUI Charts. </p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/8DO15.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8DO15.png" alt="enter image description here"></a>  </p>
  
  <pre><code>struct DashboardACFT: View {
      @FetchRequest(entity: ACFTScores.entity(), sortDescriptors: [NSSortDescriptor(keyPath: \ACFTScores.totalScore, ascending: true)]) var acftScores: FetchedResults&lt;ACFTScores&gt;
  
      var body: some View {
          VStack {
              ForEach(acftScores, id: \.id) { score in
                  BarChartView(data: [Int(score.totalScore)], title: "Title", legend: "Legendary")
              }
          }
      }
  }
  </code></pre>