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

vertical labels on x-axis #10

Open
zcaudate opened this issue Apr 17, 2019 · 7 comments
Open

vertical labels on x-axis #10

zcaudate opened this issue Apr 17, 2019 · 7 comments

Comments

@zcaudate
Copy link

sometimes when there are too many categories on the horizontal axis, the labels will merge into each other. Is it possible to print the x-axis labels vertically?

@genmeblog
Copy link
Contributor

There is parameter :angle for add-axes. Try to use it, I'm not sure if it work properly though.

@zcaudate
Copy link
Author

I tried:

(build/add-axes :bottom {:angle (or x-angle 0)})

but I don't think it does anything

Screen Shot 2019-04-17 at 4 04 08 pm

@genmeblog
Copy link
Contributor

ok, I'll check it. This can be kind of tricky issue. I draw axes on rotated and translated canvas so sometimes it can give a mess.

@genmeblog
Copy link
Contributor

anyway, thanks for spotting this issues it helps me to find crucial bugs quicker

@zcaudate
Copy link
Author

I'm using the horizontal bar chart at the moment to get around it. Loving the library so far and looking to see what use cases I can/can't do.

@genmeblog
Copy link
Contributor

genmeblog commented Apr 17, 2019

The parameter was wrong, should be {:ticks {:text-angle -90}} but still, doesn't work properly (fortunately I know why).
image

@genmeblog
Copy link
Contributor

implementation notes:
For each axis type (left/right, top/bottom) prepare positioning info for given angle range.
Eg. for bottom angle 0, centered, angle (0-90) - left align, angle [90,180) - right align, etc.
Also, create function returning size which is going to be used by marks (roughly: r*sin(angle) where r=sqrt(w^2+(h/2)^2))

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

No branches or pull requests

2 participants