4 Replies Latest reply on Aug 1, 2008 10:36 AM by Gregory Lafrance

    labelRotation does not work with ColumnChart

    finecur
      I found that labelRotation does not work for ColumnChart. Could anyone confirm? here is my code. I am using flex 2.0.1.

      Thanks,

      <?xml version="1.0" encoding="utf-8"?>
      <!-- http://blog.flexexamples.com/2007/10...otation-style/ -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml"
      layout="vertical"
      verticalAlign="middle"
      backgroundColor="white">

      <mx:Style>
      @font-face {
      src: local("Arial");
      font-family: EmbeddedArial;
      }

      BarChart {
      font-family: EmbeddedArial;
      }
      </mx:Style>

      <mx:ArrayCollection id="arrColl">
      <mx:source>
      <mx:Array>
      <mx:Object name="R Winn" obp=".353" slg=".445" avg=".300" />
      <mx:Object name="P Feliz" obp=".290" slg=".418" avg=".253" />
      <mx:Object name="O Vizquel" obp=".305" slg=".316" avg=".246" />
      <mx:Object name="B Molina" obp=".298" slg=".433" avg=".276" />
      <mx:Object name="R Durham" obp=".295" slg=".343" avg=".218" />
      </mx:Array>
      </mx:source>
      </mx:ArrayCollection>

      <mx:ApplicationControlBar dock="true">
      <mx:Form>
      <mx:FormHeading label="labelRotation" />
      <mx:FormItem label="horizontalAxisRenderer:">
      <mx:HSlider id="horizontalLabelRotation"
      minimum="-90"
      maximum="90"
      value="0"
      liveDragging="true"
      snapInterval="10"
      tickInterval="10" />
      </mx:FormItem>
      <mx:FormItem label="verticalAxisRenderer:">
      <mx:HSlider id="verticalLabelRotation"
      minimum="-90"
      maximum="90"
      value="0"
      liveDragging="true"
      snapInterval="10"
      tickInterval="10" />
      </mx:FormItem>
      </mx:Form>

      <mx:Spacer width="100%" />

      <mx:Legend dataProvider="{barChart}"/>
      </mx:ApplicationControlBar>

      <mx:ColumnChart id="barChart"
      showDataTips="true"
      dataProvider="{arrColl}"
      width="100%"
      height="100%">

      <mx:horizontalAxis>
      <mx:CategoryAxis dataProvider="{arrColl}" categoryField="name"/>

      </mx:horizontalAxis>
      <!-- horizontal axis renderer -->
      <mx:horizontalAxisRenderer>
      <mx:AxisRenderer labelRotation="{horizontalLabelRotation.value}" />
      </mx:horizontalAxisRenderer>

      <!-- series -->
      <mx:series>
      <mx:ColumnSeries id="obpSeries"
      yField="obp"
      xField="name"
      displayName="obp" />
      <mx:ColumnSeries id="slgSeries"
      yField="slg"
      xField="name"
      displayName="slg" />
      <mx:ColumnSeries id="avgSeries"
      yField="avg"
      xField="name"
      displayName="avg" />
      </mx:series>
      </mx:ColumnChart>

      </mx:Application>