Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct AnalyticsReportCard: View {

// Layout metrics that scale based on accessibility changes
@ScaledMetric private var scaledChartWidth: CGFloat = Layout.chartWidth
@ScaledMetric private var scaledChartHeight: CGFloat = Layout.chartHeight

var body: some View {
VStack(alignment: .leading, spacing: Layout.titleSpacing) {
Expand Down Expand Up @@ -57,7 +56,8 @@ struct AnalyticsReportCard: View {
.shimmering(active: isRedacted)

AnalyticsLineChart(dataPoints: leadingChartData, lineChartColor: leadingChartColor)
.frame(width: scaledChartWidth, height: scaledChartHeight)
.aspectRatio(Layout.chartAspectRatio, contentMode: .fit)
.frame(maxWidth: scaledChartWidth)
}

}
Expand All @@ -81,7 +81,8 @@ struct AnalyticsReportCard: View {
.shimmering(active: isRedacted)

AnalyticsLineChart(dataPoints: trailingChartData, lineChartColor: trailingChartColor)
.frame(width: scaledChartWidth, height: scaledChartHeight)
.aspectRatio(Layout.chartAspectRatio, contentMode: .fit)
.frame(maxWidth: scaledChartWidth)
}
}
.frame(maxWidth: .infinity, alignment: .leading)
Expand All @@ -107,6 +108,7 @@ private extension AnalyticsReportCard {
static let columnInnerSpacing: CGFloat = 10
static let chartHeight: CGFloat = 32
static let chartWidth: CGFloat = 72
static let chartAspectRatio: CGFloat = 2.25
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ struct AnalyticsTimeRangeCard: View {
.bold()
}
.padding(.leading)
.fixedSize(horizontal: false, vertical: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is needed to prevent multiline text truncation:

.frame(maxWidth: .infinity, alignment: .leading)

Image(uiImage: .chevronDownImage)
Expand Down