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

the text rotation (Cry for help) #505

Closed
931743010 opened this issue Oct 26, 2015 · 6 comments
Closed

the text rotation (Cry for help) #505

931743010 opened this issue Oct 26, 2015 · 6 comments

Comments

@931743010
Copy link

old lable:
image
new lable effect:
image
how to rotate the label to Stand up to see more dates.

it‘s best to give a demo.

@danielgindi
Copy link
Collaborator

Duplicate #61

If you want to rush this - you can give it a try implementing this yourself. Basically you need to rotate the CG matrix before drawing, and you need to rotate it also when calculating the "longest label width" - to consider the angle.

@liuxuan30
Copy link
Member

I tried once, but seems I missed something, I rotate the text and the text is gone... Must miss something like anchor point

@danielgindi
Copy link
Collaborator

I have just implemented this. Cheers :-)

(And yes, it was a lot of sitting with a pen, drawing bounds and angles, and figuring out what goes where...)

@931743010
Copy link
Author

Thank you so much for yours attention to this problem. i Look forward to ,haha

@liuxuan30
Copy link
Member

woooooow can't wait it and learn another lesson! The matrix is killing me :)

@danielgindi
Copy link
Collaborator

The headache here is the anchor points. You want to draw the text rotated
around its center, and align left/right only the outer box which encloses
the rotated label. So you have virtually two anchor point.

When I'll add multiline support to horizontal chart's axis labels, I'll
need to be able to specify text alignment, and compensate for that in all
that math- which I think affects Android only because it changes the
drawing anchor point according to the alignment property...

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

3 participants