diff --git a/src/axes/Axis.ts b/src/axes/Axis.ts index ad58cd64..f0313a68 100644 --- a/src/axes/Axis.ts +++ b/src/axes/Axis.ts @@ -91,7 +91,10 @@ export abstract class Axis { // If we don't have a label ahead and we have only two labels in total, we just take the remaining distance to // on the whole axis length. We limit that to a minimum of 30 pixel, so that labels close to the border will // still be visible inside of the chart padding. - labelLength = Math.max(this.axisLength - projectedValue, 30); + labelLength = Math.max( + this.axisLength - projectedValue, + this.axisLength / this.ticks.length + ); } // Skip grid lines and labels where interpolated label values are falsey (except for 0) diff --git a/test/__image_snapshots__/BarChart__Adaptive__iPad-snap.png b/test/__image_snapshots__/BarChart__Adaptive__iPad-snap.png index 754832d3..f2166847 100644 Binary files a/test/__image_snapshots__/BarChart__Adaptive__iPad-snap.png and b/test/__image_snapshots__/BarChart__Adaptive__iPad-snap.png differ diff --git a/test/__image_snapshots__/BarChart__Adaptive__iPhone-X-landscape-snap.png b/test/__image_snapshots__/BarChart__Adaptive__iPhone-X-landscape-snap.png index 6cdddbe9..117cd64f 100644 Binary files a/test/__image_snapshots__/BarChart__Adaptive__iPhone-X-landscape-snap.png and b/test/__image_snapshots__/BarChart__Adaptive__iPhone-X-landscape-snap.png differ diff --git a/test/__image_snapshots__/BarChart__Default-snap.png b/test/__image_snapshots__/BarChart__Default-snap.png index 10e6127f..f1793164 100644 Binary files a/test/__image_snapshots__/BarChart__Default-snap.png and b/test/__image_snapshots__/BarChart__Default-snap.png differ diff --git a/test/__image_snapshots__/BarChart__Horizontal-snap.png b/test/__image_snapshots__/BarChart__Horizontal-snap.png index 77961f14..bdcc98f9 100644 Binary files a/test/__image_snapshots__/BarChart__Horizontal-snap.png and b/test/__image_snapshots__/BarChart__Horizontal-snap.png differ diff --git a/test/__image_snapshots__/BarChart__Overlapping-Bars-On-Mobile__iPhone-X-snap.png b/test/__image_snapshots__/BarChart__Overlapping-Bars-On-Mobile__iPhone-X-snap.png index b7679c54..c9ee0496 100644 Binary files a/test/__image_snapshots__/BarChart__Overlapping-Bars-On-Mobile__iPhone-X-snap.png and b/test/__image_snapshots__/BarChart__Overlapping-Bars-On-Mobile__iPhone-X-snap.png differ