Skip to content

Commit

Permalink
Labels can get bigger when the 2nd fit happens. Don't arbitrarily for…
Browse files Browse the repository at this point in the history
…ce the size to change
  • Loading branch information
etimberg committed Nov 20, 2016
1 parent 58afbe4 commit 68b00b2
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ module.exports = function(Chart) {
me.paddingRight = me.labelRotation !== 0 ? (sinRotation * (tickFontSize / 2)) + 3 : lastLabelWidth / 2 + 3; // when rotated
} else {
// A vertical axis is more constrained by the width. Labels are the dominant factor here, so get that length first
var maxLabelWidth = me.maxWidth - minSize.width;

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

if (largestTextWidth < maxLabelWidth) {
// We don't need all the room
minSize.width += largestTextWidth;
} else {
// Expand to max size
minSize.width = me.maxWidth;
}

minSize.width += largestTextWidth;
me.paddingTop = tickFontSize / 2;
me.paddingBottom = tickFontSize / 2;
}
Expand Down

0 comments on commit 68b00b2

Please sign in to comment.