From: etimberg Date: Sat, 5 Nov 2016 01:31:00 +0000 (-0400) Subject: Labels can get bigger when the 2nd fit happens. Don't arbitrarily force the size... X-Git-Tag: v2.5.0~1^2~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=68b00b2dc512b9041037c5f87fc28fcc7ac5b9fa;p=thirdparty%2FChart.js.git Labels can get bigger when the 2nd fit happens. Don't arbitrarily force the size to change --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index ce399219b..bc09cb0ae 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -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; @@ -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; }