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

Legend is squished together #1005

Closed
jjjj12212 opened this issue Feb 18, 2015 · 6 comments
Closed

Legend is squished together #1005

jjjj12212 opened this issue Feb 18, 2015 · 6 comments
Labels
C-bug Category: This is a bug resolved maybe

Comments

@jjjj12212
Copy link

I was setting this up today and found the legend is too close together yet my code is I believe is pretty basic. Please Note that the /head body tags was missing. When I added it, it made no difference.

2015-02-18_15-23-36

2015-02-18_15-22-07

Any ideas how to fix it?

@ergo
Copy link

ergo commented Feb 26, 2015

Yeah happens also for my charts on random.

@mrj
Copy link

mrj commented Feb 27, 2015

Commit d35f0f8 for issue #942 is what broke this.

@mrj
Copy link

mrj commented Feb 27, 2015

The problem is caused by a function that creates a temporary SVG element to hold legend text so that the dimensions of this text can be determined. The height of this SVG element was set to zero in commit d35f0f8 to prevent the temporary SVG element from flickering the scrollbar (issue #942). This however had the side effect of setting the heights of all legend text boxes to zero.

Perhaps the solution to both problems is to take the temporary SVG element out of the flow so it doesn't trigger the scrollbar:

svg = body.append("svg").style('visibility', 'hidden').style('position', 'fixed').style('top', 0).style('left', 0)

Maybe you can get away without setting the top-left zero positions:

svg = body.append("svg").style('visibility', 'hidden').style('position', 'absolute')

@smuuf
Copy link

smuuf commented Mar 2, 2015

@mrj Oh well, thank you! :)

@masayuki0812
Copy link
Member

Thanks for looking into this. I fixed to use position = fixed and now it seems working.
I'll release this fix in the next version 0.4.10 after RC test. Thanks!

@masayuki0812
Copy link
Member

0.4.10 has been released, so let me close at the moment. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug resolved maybe
Projects
None yet
Development

No branches or pull requests

5 participants