Displaying multiple datasets
In this recipe, we’ll take the chart we just built and enhance it so we can add another set of coffee performance rating data. Charts are great for comparing sets of data because a viewer can better see how the sets align or differ, and by how much.
Because Swift Charts streamlines building charts for all kinds of data and scenarios, it won’t take much to add our new set. However, we may want to make a few modifications to make our data stand out clearly.
How to do it...
Let’s start where we left off in our previous project:
- We’ll first start by adding another set of coffee performance data:
var johnPerfInfo: [PerformanceInfo] = [
.init(cups: 0, rating: 1),
.init(cups: 1, rating: 1),
.init(cups: 2, rating: 1),
.init(cups: 3, rating: 3),
.init(cups: 4, rating: 5),
.init(cups...