0 Replies Latest reply on Oct 20, 2010 6:45 AM by bindu84

    label

    bindu84

      how to align datalabel to center in bar and column chart if labelPosition is outside

       

       

       

       

       

       

       

      xmlns:mx="http://www.adobe.com/2006/mxml" initialize="setStartLabelLocation()">

       

      <mx:Script><![CDATA[

       

      import mx.collections.ArrayCollection;

       

      Bindable]

       

      public var expenses:ArrayCollection = new ArrayCollection([

       

      "Jan", Income:2000, Expenses:1500},

       

      "Feb", Income:1000, Expenses:20},

       

      "Mar", Income:1500, Expenses:50}

       

      private function setStartLabelLocation():void {

       

      "labelPosition", "outside");

       

      "labelPosition", "outside");

       

      </mx:Script>

       

       

      <mx:Panel title="Column Chart">

       

      <mx:ColumnChart id="myChart"

       

      {expenses}"

       

      true"

       

      >

       

      <mx:horizontalAxis>

       

      <mx:CategoryAxis

       

      {expenses}"

       

      Month"

       

      />

       

      </mx:horizontalAxis>

       

       

      <mx:verticalAxis>

       

      <mx:LinearAxis minimum="0" maximum="2500"/>

       

      </mx:verticalAxis>

       

       

      <mx:series>

       

      <mx:ColumnSeries

       

      cs1"

       

      Month"

       

      Income"

       

      Income"

       

      />

       

      <mx:ColumnSeries

       

      cs2"

       

      Month"

       

      Expenses"

       

      Expenses"

       

      />

       

      </mx:series>

       

      </mx:ColumnChart>

       

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

       

      </mx:Panel>

       

       

      </mx:Application>

       

       

      displayName="

      yField="

      xField="

      id="

       

      displayName="

      yField="

      xField="

      id="

       

      categoryField="

      dataProvider="

       

      showDataTips="

      dataProvider="

      }

       

       

      ]]>

      cs2.setStyle(

      cs1.setStyle(

      ]);

       

       

      {Month:

      {Month:

      {Month:

       

       

      [

       

      <mx:Application

      <!-- charts/BasicDataLabel.mxml -->