You can definitely use Grid for this! You can do something like this: Grid{ GridRow { ForEach(0..<3) { _ in Text(header) .padding() } } ForEach(0..<3){ num in GridRow { Text((num)) .padding() ForEach(0..<2) { _ in Text(X) .padding() } } } } The first GridRow would iterate through your data for your headers. Here, I have 3 headers as I will only be using 3 columns for my data. Then, I have a ForEach that gives me 3 more GridRows. Each of these contain the label for the vertical axis label and then another ForEach that contains the data for that row. This gives you both vertical and horizontal axis labels and the data is laid out by row.
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: