Skip to content

Commit 4968334

Browse files
committed
fix: label position fix
fixes #1266 fixes #1266
1 parent b90cfea commit 4968334

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/axes/Axis.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ export abstract class Axis {
9191
// If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to
9292
// on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will
9393
// still be visible inside of the chart padding.
94-
labelLength = Math.max(this.axisLength - projectedValue, 30);
94+
labelLength = Math.max(
95+
this.axisLength - projectedValue,
96+
this.axisLength / this.ticks.length
97+
);
9598
}
9699

97100
// Skip grid lines and labels where interpolated label values are falsey (except for 0)

0 commit comments

Comments
 (0)