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

Chart Labels are cut off at some chart sizes #4623

Closed
ChrisGrohHS opened this issue Aug 7, 2017 · 4 comments
Closed

Chart Labels are cut off at some chart sizes #4623

ChrisGrohHS opened this issue Aug 7, 2017 · 4 comments

Comments

@ChrisGrohHS
Copy link

Expected Behavior

Entirety of axis labels should be visible.

Current Behavior

The chart y-axis labels are cut off.

Possible Solution

It seems like the issue is from multiple attempts to fit the y-axis. The first time, it uses the ticks values of ["5","4","3","2","1","0"]. It then sets the minWidth of the scale to the width calculated from these single-digit values. The UI then does a second fit using the values ["5.0","4.5","4.0","3.5","3.0","2.5","2.0","1.5","1.0","0.5","0"]. With this fit, in core.scale.js on the line "minSize.width = Math.min(me.maxWidth, minSize.width + largestTextWidth);", the maxWidth is the width from when the labels were a single digit.

Steps to Reproduce (for bugs)

https://codepen.io/anon/pen/VzpLqd

Context

I think as a workaround, I can manually specify the ticks for now.

Environment

  • Chart.js version: 2.6.0
  • Browser name and version: Chrome 59
@etimberg
Copy link
Member

etimberg commented Aug 7, 2017

Thanks for reporting this. I believe this is a duplicate of another recently reported issue (though I can't find the exact issue at this time)

@kyletinsley
Copy link

I'm having the same issue as well. Tried v2.6 and v2.7. Any update on this?

@ypresto
Copy link

ypresto commented Oct 6, 2017

@etimberg #4340 looks different issue. IMO this one is not duplicate, isn't it?

@etimberg
Copy link
Member

Fixed in #4942

@etimberg etimberg added this to the Version 2.8 milestone Nov 25, 2017
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

4 participants