Skip to content

Commit

Permalink
Merge pull request #177 from willdale/bugfix/fix-infobox-placement
Browse files Browse the repository at this point in the history
Set the offset for infobox to half the height of the space.
  • Loading branch information
willdale authored Mar 19, 2022
2 parents 7b50b53 + 718bab3 commit 4a96cc8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public final class RangedBarChartData: CTRangedBarChartDataProtocol, GetDataProt

GeometryReader { geo in
ZStack {
ForEach(self.dataSets.dataPoints.indices) { i in
ForEach(self.dataSets.dataPoints.indices, id: \.self) { i in
if let label = self.dataSets.dataPoints[i].xAxisLabel {
if label != "" {
TempText(chartData: self, label: label, rotation: angle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public final class LineChartData: CTLineChartDataProtocol, GetDataProtocol, Publ

GeometryReader { geo in
ZStack {
ForEach(self.dataSets.dataPoints.indices) { i in
ForEach(self.dataSets.dataPoints.indices, id: \.self) { i in
if let label = self.dataSets.dataPoints[i].xAxisLabel {
if label != "" {
TempText(chartData: self, label: label, rotation: angle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal struct InfoBox<T>: ViewModifier where T: CTLineBarChartDataProtocol {
.position(x: chartData.setBoxLocation(touchLocation: chartData.infoView.touchLocation.x,
boxFrame: boxFrame,
chartSize: chartData.infoView.chartSize) - 6, // -6 to compensate for `.padding(.horizontal, 6)`
y: 35)
y: height / 2)
.frame(height: height)
.padding(.horizontal, 6)
.zIndex(1)
Expand Down

0 comments on commit 4a96cc8

Please sign in to comment.