]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Cleaner handling of fitting no ticks (#7212)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Sun, 22 Mar 2020 17:40:16 +0000 (10:40 -0700)
committerGitHub <noreply@github.com>
Sun, 22 Mar 2020 17:40:16 +0000 (13:40 -0400)
src/core/core.scale.js

index 94c21f6f092a446b716e1f7a550dd4df494dc0fb..606bf0cd646964e03b8d0fad4017a6b7d27b9ab2 100644 (file)
@@ -726,7 +726,7 @@ export default class Scale extends Element {
                }
 
                // Don't bother fitting the ticks if we are not showing the labels
-               if (tickOpts.display && display) {
+               if (tickOpts.display && display && me.ticks.length) {
                        const labelSizes = me._getLabelSizes();
                        const firstLabelSize = labelSizes.first;
                        const lastLabelSize = labelSizes.last;