I am trying to add some detail to a custom chart view that I have made. I currently have the chart and the title in a VStack. This is working perfectly and means the title is centred above the chart.
I now want to add a small text caption just underneath the title and above the chart on the trailing side of the view as shown below
I am struggling to understand what modifiers I need to use to set the alignment correctly to achieve this layout. Any help is appreciated.
Code:
VStack {
// Title Text
Text(title)
.font(.headline)
// The new text I want added (text 2 in the image)
Text(min)
.font(.caption)
// My current attempt but I am not sure this is right
.alignmentGuide(.trailing, computeValue: { _ in 0 })
// Chart
ChartView()
}

