Jump to content
Larry Ullman's Book Forums

How To Rotate Columnchart Labels


DuPreez
 Share

Recommended Posts

Cannot rotate columnChart labels. I'm embedding a font & using a horizontal axisrenderer, yet still I cannot rotate the labels! Please help! Here's my code:

<fx:Style>

@namespace mx "library://ns.adobe.com/flex/mx";

@font-face {

src: url("assets/fonts/DiavloM.otf");

font-family: Dia;

fontStyle: normal;

fontWeight: normal;

embedAsCFF: false;

}

mx|ColumnChart {

fontFamily: Dia;

fontSize: 12;

}

</fx:Style>

<mx:ColumnChart id="testChart2" dataProvider="{testInfo}" showDataTips="true" width="80%" height="30%">

<mx:horizontalAxis>

<mx:CategoryAxis id="haxis" categoryField="Type" dataProvider="{testInfo}"/>

</mx:horizontalAxis>

<mx:verticalAxis>

<mx:LinearAxis minimum="0" maximum="{maxNum}" interval="1"/>

</mx:verticalAxis>

<mx:series>

<mx:ColumnSeries yField="num" fontSize="10" showDataEffect="{changeEffect1}" xField="Type" displayName="Type"/>

</mx:series>

<mx:horizontalAxisRenderer>

<mx:AxisRenderer labelRotation="-45" axis="{haxis}" />

</mx:horizontalAxisRenderer>

</mx:ColumnChart>

Link to comment
Share on other sites

Flex 4. And in the meantime I got it working like so:

<fx:Style>

@namespace mx "library://ns.adobe.com/flex/mx";

@namespace s "library://ns.adobe.com/flex/spark";

@font-face {

src: local("Verdana");

fontFamily: VerdanaEmbedded;

fontWeight: bold;

color: #000000;

embedAsCFF: false;

}

mx|ColumnChart {

fontFamily: VerdanaEmbedded;

fontSize: 10;

}

 

For some reason the fontWeight must be 'bold'. If I change it to 'normal' it doesn't work anymore. A great mystery...

  • Upvote 1
Link to comment
Share on other sites

 Share

×
×
  • Create New...