1 Reply Latest reply on Apr 30, 2011 12:44 PM by Hazar Hiasat

    Can you draw chart in flex displaying Arabic Text?!

    Hazar Hiasat Level 1

      Dears,

      I am having a problem in drawing a flex chart with arabic data, the data get flipped !!!

      ArabicText In FlexChart.png

      And here is the code...

      <?xml version="1.0"?>

      <!-- http://blog.flexexamples.com/2007/11/07/creating-a-simple-piechart-in-flex-using-actionscr ipt/ -->

      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"

              layout="vertical"

              verticalAlign="middle"

              backgroundColor="white"

              creationComplete="init();">

       

          <mx:Script>

              <![CDATA[

                  import mx.charts.PieChart;

                  import mx.charts.series.PieSeries;

                  import mx.collections.ArrayCollection;

       

                  private var medalsAC:ArrayCollection;

                  private var chart:PieChart;

                  private var series:PieSeries;

       

                  /**

                   * Create and return a simple ArrayCollection to

                   * use as a data provider.

                   */

                  private function getDataProvider():ArrayCollection {

                      var arr:Array = [];

                      arr.push({label:" العينة الاولى ", data:30});

                      arr.push({label:"العينة الثانية", data:10});

                      return new ArrayCollection(arr);

                  }

       

                  private function init():void {

                      medalsAC = getDataProvider();

       

                      /* Define pie series. */

                      series = new PieSeries();

                      series.nameField = "label";

                      series.field = "data";

                      /* Remove default dropshadow filter. */

                      series.filters = [];

       

                      /* Define pie chart. */

                      chart = new PieChart();

                      chart.percentWidth = 100;

                      chart.percentHeight = 100;

                      chart.showDataTips = true;

                      chart.dataProvider = medalsAC;

                      chart.series = [series];

       

                      /* Add chart to the display list. */

                      addChild(chart);

                  }

              ]]>

          </mx:Script>

       

      </mx:Application>