Cleaner handling of fitting no ticks (#7212)

This commit is contained in:
Ben McCann 2020-03-22 10:40:16 -07:00 committed by GitHub
parent b73b8f9863
commit e46420e595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View 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;