DuPreez Posted October 3, 2011 Share Posted October 3, 2011 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 More sharing options...
Larry Posted October 6, 2011 Share Posted October 6, 2011 Could you confirm what version of Flex you're using? Link to comment Share on other sites More sharing options...
DuPreez Posted October 7, 2011 Author Share Posted October 7, 2011 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... 1 Link to comment Share on other sites More sharing options...
Larry Posted October 7, 2011 Share Posted October 7, 2011 Boy that is strange. Kudos for figuring that out and thanks for sharing your solution. Link to comment Share on other sites More sharing options...
Recommended Posts