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

Rotate X-Axis Labels 90 degrees #173

Closed
seigel opened this issue Jan 26, 2013 · 7 comments
Closed

Rotate X-Axis Labels 90 degrees #173

seigel opened this issue Jan 26, 2013 · 7 comments
Milestone

Comments

@seigel
Copy link

seigel commented Jan 26, 2013

Just wondering if it was interesting to anyone else to be able to rotate the x-axis labels 90 degrees to be able to display longer ones.

Thanks!
James

@oesmith
Copy link
Contributor

oesmith commented Jan 27, 2013

Definitely. I think it'd be great to have a choice of horizontal, diagonal or vertical labels.

@seigel
Copy link
Author

seigel commented Jan 27, 2013

Any idea what that would take or where I'd have to look to poke at that part of the code?

@oesmith
Copy link
Contributor

oesmith commented Jan 27, 2013

There's a drawXAxis method (or something similar - I don't have the code in
front of me to refer to) in Morris.Line and Morris.Bar that handles the
actual drawing, which is the majority of the code.

There's also some code somewhere that calculates the height of the x-axis
label area (I think this is in Morris.Grid at the moment), which will
probably need significant refactoring to deal with rotated labels.

Olly

On 27 Jan 2013, at 14:41, James Seigel [email protected] wrote:

Any idea what that would take or where I'd have to look to poke at that
part of the code?


Reply to this email directly or view it on
GitHubhttps://github.com/oesmith/morris.js/issues/173#issuecomment-12754973.

@dshapira
Copy link

There was a simplistic example in my rounded corners PR but it really wasn't very comprehensive. Seigel, you are welcome to take a look as a starting point at least. https://github.com/oesmith/morris.js/pull/145/files

Diagonal labels could be interesting as well since the vertical ones hit the bottom of the graph area pretty quickly. If I find the time I would like to contribute but agree that it looked like some refactoring was necessary.

@oesmith
Copy link
Contributor

oesmith commented May 10, 2013

Diagonal and vertical labels are now in master, see the code in PR #239.

@oesmith oesmith closed this as completed May 10, 2013
@Hiren701
Copy link

i want to move my x-axis to 90 degree can any one help ?

@rachheeell
Copy link

xLabelAngle: 90,
//for rotate 90 degrees

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

5 participants