Sunday, March 28, 2010

How to rotate long labels?

Here is my code to rotate labels of date in the format of?''2008-12-31'':

%26lt;!-- horizontal axis --%26gt;

%26lt;mx:horizontalAxis%26gt;
%26lt;mx:CategoryAxis id=''ca'' title='''' dataProvider=''{xyzArrayCollection}'' categoryField=''Date''/%26gt;

%26lt;/mx:horizontalAxis%26gt;

%26lt;!-- horizontal axis renderer --%26gt;
%26lt;mx:horizontalAxisRenderers%26gt;
%26lt;mx:AxisRenderer axis=''{ca}'' canDropLabels=''true'' labelRotation=''-90''/%26gt;
%26lt;/mx:horizontalAxisRenderers%26gt;

The labels are not rotated! Is this because the labels are too long?

How to rotate long labels?

You have to specify/embed the fonts see http://livedocs.adobe.com/flex/3/html/help.html?content=charts_formatting_11.htm l

How to rotate long labels?

I did. Here is my embedded font for the LineChart in the mxml:

%26lt;mx:Style%26gt;
?@font-face{
?src:local(''Verdana'');
?fontFamily: myLabelFont;
}

LineChart {
?fontFamily: myLabelFont;
?fontSize: 12;
}

%26lt;/mx:Style%26gt;

Hi,

setting labelRotation without setting embeded font should be visible - all labels should be invisible. Is it true?

Also you can try to set fontFamily for AxisRenderer.

No comments:

Post a Comment