The following example embeds a font and rotates the data labels 45 degrees: : Label Style « Components « Flex






The following example embeds a font and rotates the data labels 45 degrees:

The following example embeds a font and rotates the data labels 45 degrees:
           
<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->
<!-- charts/RotatingDataLabels.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        import mx.collections.ArrayCollection;
        [Bindable]
        public var expenses:ArrayCollection = new ArrayCollection([
            {Month:"Jan", Income:2000, Expenses:1500},
            {Month:"Feb", Income:1000, Expenses:200},
            {Month:"Mar", Income:1500, Expenses:500}
            ]);
      </mx:Script>
    <mx:Style>
        @font-face{ 
            src: url("a.ttf"); 
            fontFamily: myMyriad; 
        } 
        ColumnSeries {
            labelPosition:outside; 
            labelRotation:45; 
        } 
        ColumnChart { 
            fontFamily:myMyriad; 
        }
    </mx:Style>
    <mx:Panel title="Rotating Data Labels in a Column Chart">
        <mx:ColumnChart id="myChart" dataProvider="{expenses}"
            showDataTips="true">
            <mx:horizontalAxis>
                <mx:CategoryAxis dataProvider="{expenses}"
                    categoryField="Month" />
            </mx:horizontalAxis>
            <mx:horizontalAxisRenderer>
                <mx:AxisRenderer labelRotation="45" />
            </mx:horizontalAxisRenderer>
            <mx:verticalAxis>
                <mx:LinearAxis minimum="0" maximum="2500" />
            </mx:verticalAxis>
            <mx:series>
                <mx:ColumnSeries xField="Month" yField="Income"
                    displayName="Income" />
                <mx:ColumnSeries xField="Month" yField="Expenses"
                    displayName="Expenses" />
            </mx:series>
        </mx:ColumnChart>
    </mx:Panel>
</mx:Application>

   
    
    
    
    
    
    
    
    
    
    
  








Related examples in the same category

1.Apply style to LabelApply style to Label
2.Enable data labels on the columns by setting the value of the labelPosition style property to insideEnable data labels on the columns by setting the value of the labelPosition style property to inside
3.Label style
4.Set style name for LabelSet style name for Label
5.Set Text, font weight and font size for LabelSet Text, font weight and font size for Label
6.Set font weight and size for LabelSet font weight and size for Label
7.Overwrite Label font size with attribute
8.Name appears in the DataTip in italic font before the label dataName appears in the DataTip in italic font before the label data