Creating charts
Before we continue, let’s understand the view structure of a chart in the Swift Charts framework. As we can see from the last code example, the chart view is called Chart
:
Chart(data) { BarMark( x: .value("Fruit", $0.itemType), y: .value("qty", $0.qty) ) }
Each data point in the chart is called a Mark. In this code example, we have a Chart with three data points (marks) of the BarMark
type. If the Chart receives an array as a parameter, it...