0 Replies Latest reply on Jan 28, 2010 10:27 PM by meanseanbean

    Problem showing labels on DateTimeAxis

    meanseanbean

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="init();">
          <mx:Script>
              <![CDATA[
                  private static const minuteInMilliseconds:Number = 60*1000;

                  [Bindable] private var startDate:Date = new Date();
                  [Bindable] private var endDate:Date = new Date();
                  [Bindable] private var startVal:int = 2;
                  [Bindable] private var endVal:int;

                  private function init():void {
                      //endDate is 10 mins past startDate
                      endDate.setTime(startDate.getTime()+(10*minuteInMilliseconds));
                      endVal = 16;
                  }
              ]]>
          </mx:Script>
          <mx:LineChart>
              <mx:series>
                  <mx:LineSeries displayName="Series 1" yField=""/>
              </mx:series>
              <mx:horizontalAxis>
      <!--        <mx:DateTimeAxis dataUnits="minutes" minimum="{startDate}" maximum="{endDate}"/>-->
                  <mx:LinearAxis minimum="{startVal}" maximum="{endVal}" />
              </mx:horizontalAxis>
          </mx:LineChart>
      </mx:Application>

       

      If I run the above code, I get a LineChart with the Y axis from 0 through 100 and the X axis from 2 through 16.

      However, if I comment out the LinearAxis and uncomment the DateTimeAxis, the X axis comes up blank, instead of displaying minutes.

      Is this the expected behaviour? If so, how do I get it to display minutes? If not, what am I doing wrong?


      Thank you for your time and help.