@@ -27,7 +27,6 @@ struct AnalyticsReportCard: View {
2727
2828 // Layout metrics that scale based on accessibility changes
2929 @ScaledMetric private var scaledChartWidth : CGFloat = Layout . chartWidth
30- @ScaledMetric private var scaledChartHeight : CGFloat = Layout . chartHeight
3130
3231 var body : some View {
3332 VStack ( alignment: . leading, spacing: Layout . titleSpacing) {
@@ -57,7 +56,8 @@ struct AnalyticsReportCard: View {
5756 . shimmering ( active: isRedacted)
5857
5958 AnalyticsLineChart ( dataPoints: leadingChartData, lineChartColor: leadingChartColor)
60- . frame ( width: scaledChartWidth, height: scaledChartHeight)
59+ . aspectRatio ( Layout . chartAspectRatio, contentMode: . fit)
60+ . frame ( maxWidth: scaledChartWidth)
6161 }
6262
6363 }
@@ -81,7 +81,8 @@ struct AnalyticsReportCard: View {
8181 . shimmering ( active: isRedacted)
8282
8383 AnalyticsLineChart ( dataPoints: trailingChartData, lineChartColor: trailingChartColor)
84- . frame ( width: scaledChartWidth, height: scaledChartHeight)
84+ . aspectRatio ( Layout . chartAspectRatio, contentMode: . fit)
85+ . frame ( maxWidth: scaledChartWidth)
8586 }
8687 }
8788 . frame ( maxWidth: . infinity, alignment: . leading)
@@ -107,6 +108,7 @@ private extension AnalyticsReportCard {
107108 static let columnInnerSpacing : CGFloat = 10
108109 static let chartHeight : CGFloat = 32
109110 static let chartWidth : CGFloat = 72
111+ static let chartAspectRatio : CGFloat = 2.25
110112 }
111113}
112114
0 commit comments