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

When Resizing Chart, Legend can Overflow into the Chart #5606

Closed
gkemp94 opened this issue Jun 28, 2018 · 1 comment · Fixed by #5816
Closed

When Resizing Chart, Legend can Overflow into the Chart #5606

gkemp94 opened this issue Jun 28, 2018 · 1 comment · Fixed by #5816
Milestone

Comments

@gkemp94
Copy link

gkemp94 commented Jun 28, 2018

When resizing a chart with lots of legend items on the left, the labels can overlap onto the chart.

Steps to Reproduce (for bugs)

Code Pen

  1. Open Codepen
  2. Resize preview window horizontally and notice that the final item at overlaps the chart

Context

We have a chart with lots of datasets, it works fine until it's resized within it's container and then sometimes the labels overlap onto the chart.

Environment

  • Chart.js version: Latest Version
  • Browser name and version: Chrome Latest Version

image

@gkemp94
Copy link
Author

gkemp94 commented Jun 28, 2018

Took a look at this to see what was going wrong, seems as though it's calculating the layout of the legend box assuming full height but then when calculating layout of the boxes we clip the area by the height of both the bottom & top boxes. A solution might be to treat vertical boxes the same as horizontal boxes and if fullWidth is true, prevent the legend box being clipped.

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

Successfully merging a pull request may close this issue.

3 participants