Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68b00b2

Browse files
committed
Labels can get bigger when the 2nd fit happens. Don't arbitrarily force the size to change
1 parent 58afbe4 commit 68b00b2

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/core/core.scale.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,6 @@ module.exports = function(Chart) {
353353
me.paddingRight = me.labelRotation !== 0 ? (sinRotation * (tickFontSize / 2)) + 3 : lastLabelWidth / 2 + 3; // when rotated
354354
} else {
355355
// A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
356-
var maxLabelWidth = me.maxWidth - minSize.width;
357356

358357
// Account for padding
359358
var mirror = tickOpts.mirror;
@@ -364,14 +363,7 @@ module.exports = function(Chart) {
364363
largestTextWidth = 0;
365364
}
366365

367-
if (largestTextWidth < maxLabelWidth) {
368-
// We don't need all the room
369-
minSize.width += largestTextWidth;
370-
} else {
371-
// Expand to max size
372-
minSize.width = me.maxWidth;
373-
}
374-
366+
minSize.width += largestTextWidth;
375367
me.paddingTop = tickFontSize / 2;
376368
me.paddingBottom = tickFontSize / 2;
377369
}

0 commit comments

Comments
 (0)