Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_maxLabelLines undefined in master #6095

Closed
benmccann opened this issue Feb 27, 2019 · 5 comments
Closed

_maxLabelLines undefined in master #6095

benmccann opened this issue Feb 27, 2019 · 5 comments
Milestone

Comments

@benmccann
Copy link
Contributor

benmccann commented Feb 27, 2019

Regression from #5922

_maxLabelLines is set only when tickOpts.display && display, which causes a NaN due to _maxLabelLines being undefined in _tickSize

me._maxLabelLines = tallestLabelHeightInLines;

var h = me._maxLabelLines * tickFont.lineHeight + padding;

@benmccann benmccann added this to the Version 2.8 milestone Feb 27, 2019
@kurkle
Copy link
Member

kurkle commented Feb 28, 2019

does that fix it for you in your development branch:
var h = me._maxLabelLines * tickFont.lineHeight + padding || 0;

@benmccann
Copy link
Contributor Author

That doesn't seem right to me. Shouldn't we use the actual number of label lines instead of 0?

@kurkle
Copy link
Member

kurkle commented Feb 28, 2019

Not sure what you are working towards, but I don't think you need to consider label height if its not visible.

@benmccann
Copy link
Contributor Author

benmccann commented Feb 28, 2019

It looks like there are different options for tick and grid line visibility. What if ticks are not visible, but grid lines are?

@benmccann
Copy link
Contributor Author

Though it looks like options.ticks.display actually controls whether the labels are shown and I suppose that we don't have to worry about skipping labels to fit them all in that case, which I think is what you were suggesting

Perhaps we could change from:

var ticks = optionTicks.autoSkip ? me._autoSkip(me.getTicks()) : me.getTicks();

To:

var ticks = optionTicks.display && optionTicks.autoSkip ? me._autoSkip(me.getTicks()) : me.getTicks();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants