[ 
https://issues.apache.org/jira/browse/FLEX-32919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13580156#comment-13580156
 ] 

Maurice Amsellem commented on FLEX-32919:
-----------------------------------------

The DateTimeAxis needs to span several months for the bug to occur.
Here is a sample app (adapted from mx:DateTimeAxis doc)

<?xml version="1.0"?>
<!-- Simple example to demonstrate the DateTimeAxis class. -->
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx">

    <fx:Script>
        <![CDATA[
        import mx.collections.ArrayCollection;

        [Bindable]
        public var stockDataAC:ArrayCollection = new ArrayCollection([
            {date: "2012/11/1", value: 10},
            {date: "2012/12/1", value: 25},
            {date: "2013/1/1", value:30},
            {date: "2013/2/1", value: 42},
            {date: "2013/3/1", value: 48},
        ]);
        ]]>
    </fx:Script>

    <mx:LineChart id="mychart" height="100%" width="100%"  
dataProvider="{stockDataAC}">

        <mx:horizontalAxis>
            <mx:DateTimeAxis/>
        </mx:horizontalAxis>

        <mx:series>
            <mx:LineSeries yField="value" xField="date" displayName="Test"/>
        </mx:series>
    </mx:LineChart>

</s:Application>

Attached screenshots shows the result with SDK 4.1 (axis labels in wrong order) 
and in SDK 4.9 (axis labels is correct order)
                
> Issue is with the mx.charts.DateTimeAxis class
> ----------------------------------------------
>
>                 Key: FLEX-32919
>                 URL: https://issues.apache.org/jira/browse/FLEX-32919
>             Project: Apache Flex
>          Issue Type: Bug
>          Components: Charts
>    Affects Versions: Adobe Flex SDK Previous
>         Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Language Found: English
>            Reporter: Adobe JIRA
>
> Steps to reproduce:
> 1. Please add DateTimeAxis in any chart component and add min and max range 
> to the month like min is nov,2010 and max is jan 2011 and set the direction 
> as normal
> 2. Check the labels. It will reverted in the descending order but the 
> behavior should be like it should show in ascending order. 
> 3. The code which has issue is as follows inside the buildLabelCache() method 
> of the class. For non inverted option as well in the else part is also 
> treated as inverted one.
> if(direction == "inverted")
>                               labelCache.push(new AxisLabel(
>                               1 - (dTime - computedMinimum) / r, new 
> Date(dTime),
>                               lfunc(labelDate, previousValue, this)));
>                         else
>                               labelCache.push(new AxisLabel(
>                               1 - (dTime - computedMinimum) / r, new 
> Date(dTime),
>                                       lfunc(labelDate, previousValue, this)));
> So the correction should be in the else part the code should be like the 
> following.
> labelCache.push(new AxisLabel(
>                               (dTime - computedMinimum) / r, new Date(dTime),
>                                       lfunc(labelDate, previousValue, this)));
>  
>  Actual Results: Labels are displayed in the descending order 
>  
>  
>  Expected Results: Labels should come as ascending for the dates.
>  
>  
>  Workaround (if any): If we can fix the code and rebuild the flex which right 
> now i am not knowing how to do it but i will figure out soon as i am seeing 
> ant build scripts and i have a experience with the same.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to