Skip to content

Commit

Permalink
Merge pull request #167 from kunalverma25/xAxisLabelHeightFix
Browse files Browse the repository at this point in the history
XAxis Label Height distortion fix
  • Loading branch information
willdale authored Mar 12, 2022
2 parents 0a538b2 + 80786c6 commit e8c3dca
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ internal struct RotatedText<ChartData>: View where ChartData: CTLineBarChartData
Color.clear
.onAppear {
finalFrame = geo.frame(in: .local)
chartData.viewData.xAxisLabelHeights.append(geo.frame(in: .local).width)
if rotation == .degrees(0) || rotation == .radians(0) {
chartData.viewData.xAxisLabelHeights.append(geo.frame(in: .local).height)
chartData.viewData.xAxislabelWidths.append(geo.frame(in: .local).width)
} else {
chartData.viewData.xAxisLabelHeights.append(geo.frame(in: .local).width)
chartData.viewData.xAxislabelWidths.append(geo.frame(in: .local).height)
}
}
Expand Down

0 comments on commit e8c3dca

Please sign in to comment.