Apache Flex
  1. Apache Flex
  2. FLEX-32919

Issue is with the mx.charts.DateTimeAxis class

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK Previous
    • Fix Version/s: None
    • Component/s: Charts
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      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.

        Activity

        Hide
        Adobe JIRA added a comment -

        Adobe Bug URL: http://bugs.adobe.com/jira/browse/FLEXDMV-2549
        Original Reporter: rajeshsingh1979@gmail.com
        Discoverability: High
        Number of votes: 0
        Reproducibility: Every Time
        Severity: Usability Issue
        reporter: rajeshsingh1979@gmail.com

        Show
        Adobe JIRA added a comment - Adobe Bug URL: http://bugs.adobe.com/jira/browse/FLEXDMV-2549 Original Reporter: rajeshsingh1979@gmail.com Discoverability: High Number of votes: 0 Reproducibility: Every Time Severity: Usability Issue reporter: rajeshsingh1979@gmail.com
        Hide
        Adobe JIRA added a comment -

        created: 2011-01-19 01:47:03.000
        updated: 2011-08-25 06:12:36.000

        Show
        Adobe JIRA added a comment - created: 2011-01-19 01:47:03.000 updated: 2011-08-25 06:12:36.000
        Hide
        Adobe JIRA added a comment -

        On 2011-08-25 06:12:36.304 rahuls9009 commented:
        Assigning to Ruhee.

        Show
        Adobe JIRA added a comment - On 2011-08-25 06:12:36.304 rahuls9009 commented: Assigning to Ruhee.
        Hide
        Maurice Amsellem added a comment - - edited

        It looks like this issue has been already fixed (see below) .
        Shall we mark it as resolved ?

        cf. http://svn.apache.org/repos/asf/incubator/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/DateTimeAxis.as
        line 1513:

                           else
                                if(direction == "inverted")
                                    labelCache.push(new AxisLabel(
                                        1 - (dTime - computedMinimum) / r, new Date(dTime),
                                        lfunc(labelDate, previousValue, this)));
                                else
                                    labelCache.push(new AxisLabel(
               ==>                            (dTime - computedMinimum) / r, new Date(dTime),
                                        lfunc(labelDate, previousValue, this)));
        
        Show
        Maurice Amsellem added a comment - - edited It looks like this issue has been already fixed (see below) . Shall we mark it as resolved ? cf. http://svn.apache.org/repos/asf/incubator/flex/sdk/trunk/frameworks/projects/charts/src/mx/charts/DateTimeAxis.as line 1513: else if (direction == "inverted" ) labelCache.push( new AxisLabel( 1 - (dTime - computedMinimum) / r, new Date(dTime), lfunc(labelDate, previousValue, this ))); else labelCache.push( new AxisLabel( ==> (dTime - computedMinimum) / r, new Date(dTime), lfunc(labelDate, previousValue, this )));
        Hide
        OmPrakash Muppirala added a comment -

        Any idea how to test this?

        Show
        OmPrakash Muppirala added a comment - Any idea how to test this?
        Hide
        Maurice Amsellem added a comment -

        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)

        Show
        Maurice Amsellem added a comment - 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)

          People

          • Assignee:
            Unassigned
            Reporter:
            Adobe JIRA
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:

              Development