generateme / cljplot

JVM Clojure charting library
Eclipse Public License 2.0
152 stars 7 forks source link

vertical labels on x-axis #10

Open zcaudate opened 5 years ago

zcaudate commented 5 years ago

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 commented 5 years ago

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

zcaudate commented 5 years ago

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 commented 5 years ago

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 commented 5 years ago

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

zcaudate commented 5 years ago

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 commented 5 years ago

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

genmeblog commented 5 years ago

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))