2010-05-28 1 views
0

플렉스 날짜 시간 축이 표시되지 않을 올바른 값

<fx:Declarations> 
    <!-- Place non-visual elements (e.g., services, value objects) here --> 

</fx:Declarations> 
<fx:Script> 
    <![CDATA[ 

    import mx.collections.ArrayCollection; 

    [Bindable] 
    public var stockDataAC:ArrayCollection = new ArrayCollection([ 
    {date: "2005, 7, 27", close: 41.71}, 
    {date: "2005, 7, 28", close: 42.21}, 
    {date: "2005, 3, 29", close: 42.11}, 
    {date: "2005, 1, 1", close: 42.71}, 
    {date: "2005, 10, 2", close: 42.99}, 
    {date: "2005, 9, 3", close: 44} ]); 

    public function myParseFunction(s:String):Date { 
    // Get an array of Strings from the comma-separated String passed in. 
    var a:Array = s.split(","); 
    // Create the new Date object. Subtract one from the month property. 
    // The month property is zero-based in the Date constructor. 
    var newDate:Date = new Date(a[0],a[1]-1,a[2]); 
    return newDate; 
    } 
    ]]> 
</fx:Script> 

<mx:Panel title="DateTimeAxis Example" height="100%" width="100%"> 

    <mx:LineChart id="mychart" height="100%" width="100%" 
        paddingRight="5" paddingLeft="5" 
        showDataTips="true" dataProvider="{stockDataAC}"> 

     <mx:horizontalAxis> 
      <mx:DateTimeAxis dataUnits="days" parseFunction="myParseFunction"/> 
     </mx:horizontalAxis> 

     <mx:verticalAxis> 
      <mx:LinearAxis baseAtZero="false" /> 
     </mx:verticalAxis> 

     <mx:series> 
      <mx:LineSeries yField="close" xField="date" displayName="AAPL"/> 
     </mx:series> 
    </mx:LineChart> 

</mx:Panel> 

위의 코드는 즉 가 표시되어야합니다 날짜 축에 대한 최신의 반대 값을 보여줍니다 01/05 2/05 3/05 4/05 그러나 그것의 보여주는 10/05 09/05 08/05 07/05 날짜 축에.

도와주세요.

+0

parseFunction에 전달하는 데이터 위에있는 데이터가 있습니까? 그렇다면 어떻게 그 결과를 얻는 지 알 수 없습니다. 실제 데이터를 제공 할 수 있습니까? – quoo

+0

답장을 보내 주셔서 감사합니다 위와 동일한 데이터를 전달합니다. 위 코드를 실행하여 결과를 볼 수 있습니다. –

+0

이것은 flex SDK https://bugs.adobe.com/jira/browse/FLEXDMV-2231의 버그입니다. –

답변

0

동의합니다. 이는 Flex SDK의 버그입니다. 그것은 잠시 동안 주변에있다. 이 문제를 해결하려면 을 DateTimeAxis에 추가하십시오.