2 Replies Latest reply on May 21, 2009 9:11 PM by aruvasavi

    How to tilt the x-field label vertically in graphs

    aruvasavi

      Hi

       

      Please find the attached pic containing column graph

      Let me know how to tilt the x-field labels vertically( USA CHINA RUSSIA vertically…)

      Please find the below code and let me know...

       

       

      <?xml version="1.0"?>
      <!-- Simple example to demonstrate the ColumnChart and BarChart controls. -->
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

          <mx:Script>
              <![CDATA[
               
              import mx.collections.ArrayCollection;

              [Bindable]
              private var medalsAC:ArrayCollection = new ArrayCollection( [
                  { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
                  { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
                  { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 } ]);
              ]]>
          </mx:Script>

          <mx:Panel title="ColumnChart and BarChart Controls Example"
              height="100%" width="100%" layout="horizontal">

              <mx:ColumnChart id="column" height="100%" width="45%"
                  paddingLeft="5" paddingRight="5"
                  showDataTips="true" dataProvider="{medalsAC}">
                     
                  <mx:horizontalAxis>
                      <mx:CategoryAxis categoryField="Country"/>
                  </mx:horizontalAxis>
                     
                  <mx:series>
                      <mx:ColumnSeries xField="Country" yField="Gold" displayName="Gold"/>
                      <mx:ColumnSeries xField="Country" yField="Silver" displayName="Silver"/>
                      <mx:ColumnSeries xField="Country" yField="Bronze" displayName="Bronze"/>
                  </mx:series>
              </mx:ColumnChart>

              <mx:Legend dataProvider="{column}"/>

          </mx:Panel>
      </mx:Application>

       

       

      Thanks in Advance

      Aruna.S.N.