From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 22 Mar 2020 17:40:16 +0000 (-0700) Subject: Cleaner handling of fitting no ticks (#7212) X-Git-Tag: v3.0.0-beta.2~184 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e46420e595edaf2c3eae5c220e3864fb01a03f09;p=thirdparty%2FChart.js.git Cleaner handling of fitting no ticks (#7212) --- diff --git a/src/core/core.scale.js b/src/core/core.scale.js index 94c21f6f0..606bf0cd6 100644 --- a/src/core/core.scale.js +++ b/src/core/core.scale.js @@ -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;