1 Reply Latest reply on Oct 15, 2010 1:02 AM by vpxav

    LineChart and dateTimeAxis => Time Axis labels are inverted

    vpxav

      Hello everyone,

      I'm receiving this date format from a XML file: YYYY-MM-DD HH:MM:SS

       

      I would like to display this in a chart but I only need the YYYY-MM

       

      So, I found this function:

       

      import mx.controls.DateField;
      private function createDate(dateString:String):Date {
           var newDate:Date;
           newDate=DateField.stringToDate(dateString,"YYYY-MM");
           return newDate;
      }
      
      

       

       

       

      and here is my lineChart:

       

      <mx:LineChart id="linechart" showDataTips="true" dataProvider="{frequence}">               
           <mx:horizontalAxis>
                <mx:DateTimeAxis title="Time" alignLabelsToUnits="false" parseFunction="createDate"/>
           </mx:horizontalAxis>
           <mx:verticalAxis>
                <mx:LinearAxis baseAtZero="{checkBox.selected}" />
           </mx:verticalAxis>
           <mx:series>
                <mx:LineSeries xField="ows_Date" yField="ows_Taux"
                     form="curve" displayName="Taux de fréquence:" showDataEffect="{interpolateIn}" />
           </mx:series>
      </mx:LineChart>
      

       

      My chart displays the data correctly and in the right order (older to the left, newer to the right) but as you can see below, the time labels are inverted (older to the right and newer to the left)  while the displayed chart is not.

       

      Can anyone please help me?

      Thanks in advance!

      Capture.PNG