]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Labels can get bigger when the 2nd fit happens. Don't arbitrarily force the size...
authoretimberg <evert.timberg@gmail.com>
Sat, 5 Nov 2016 01:31:00 +0000 (21:31 -0400)
committerEvert Timberg <evert.timberg+github@gmail.com>
Sun, 20 Nov 2016 18:49:44 +0000 (13:49 -0500)
src/core/core.scale.js

index ce399219bfbeffdf27ec10dc5689f37e5537c317..bc09cb0ae7b960483ee2f52b6305584aa0b3bfd1 100644 (file)
@@ -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;
                                }