Rotating Text without Embedding Fonts
I needed this for creating an axis label for a chart. The Flex Charting label was flashing. Basically it creates a bitmap of the text and then rotates that. Obviously, you can’t select text, but, might be useful for someone. Here it is. Click the “add a text field” button. Then change text in the text input component. Rotate using the slider. Right click, view source.
Comments
6 Responses to “Rotating Text without Embedding Fonts”
Leave a Reply
This is amazing! Thank you for sharing this. :-)
Do you have any idea, how to rotate ‘text’ not ‘label’
http://blog.flexexamples.com/2007/10/15/rotating-labels-in-a-flex-chart-axis-using-the-labelrotation-style/
It should work the same. Just replace Label w/ Text in the code. It’s all based on Bitmap.
Hi Doug,
Adding my doubt here too so that it might help others. This method http://blog.flexexamples.com/2007/10/15/rotating-labels-in-a-flex-chart-axis-using-the-labelrotation-style/ says how I can rotate my labels but this mehod uses embedded fonts. Could you tell me how I could do the same without embedding fonts? I tried using RotatableLabel with labelRenderer but it didn’t work or maybe I didnt do it right. Here is the piece of code I tried out.
The data provider is an XMLList like the one below:
abc
123
… and so on.
Do tell me where I am going wrong.
Thanks a ton.
I have mailed you the code which I tried out. Kindly post it here with corrections.
Thanks.
Hi Siva,
I don’t think there’s anything wrong w/ your code. It’s just the way Flex Charting works. You have 3 options: 1. embed your font (blog.flexexamples has lots of help for that) 2. set your axis label to empty string and draw a label on top of your chart (although that will probably be a pain to keep lined up on resize) 3. extend the class that draws the axis label (not sure off hand what class that is) and use the rotating text w/o embedding fonts that I posted.
Sorry I can’t be of more help. But, w/ Flex (and especially w/ Flex Charting) many things are easy, but, you can kind of hit a wall.