Skip to content

Commit 80786c6

Browse files
author
Kunal Verma
committed
XAxis Label Height distortion fix
1 parent 6ba7163 commit 80786c6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/SwiftUICharts/SharedLineAndBar/Views/RotatedText.swift

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ internal struct RotatedText<ChartData>: View where ChartData: CTLineBarChartData
5555
Color.clear
5656
.onAppear {
5757
finalFrame = geo.frame(in: .local)
58-
chartData.viewData.xAxisLabelHeights.append(geo.frame(in: .local).width)
5958
if rotation == .degrees(0) || rotation == .radians(0) {
59+
chartData.viewData.xAxisLabelHeights.append(geo.frame(in: .local).height)
6060
chartData.viewData.xAxislabelWidths.append(geo.frame(in: .local).width)
6161
} else {
62+
chartData.viewData.xAxisLabelHeights.append(geo.frame(in: .local).width)
6263
chartData.viewData.xAxislabelWidths.append(geo.frame(in: .local).height)
6364
}
6465
}

0 commit comments

Comments
 (0)