Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6051205
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T07:47:53+00:00 2026-05-23T07:47:53+00:00

I’m kinda new to Flex and I’m using Flash Builder 4.5. I’m so frustrated..

  • 0

I’m kinda new to Flex and I’m using Flash Builder 4.5.
I’m so frustrated.. Trying to solve this since yesterday morning and seems like there is just not enough resources to learn more about Flex!

so here is the problem: I have a db field with a “date” DataType and i just can’t order by it the xField! i tried so many things and nothing works.. when i try to order it by the id its working but its not supporting dates or something.

here is the php format for the date:

      $row->date = new DateTime($row->date);
      $row->date = $row->date->format( "d/m/Y" );

now the thing is when I’m trying to make the xField=”date” its not showing the columns and the xField is still [0 20 40 60 etc..].

I’m open to new suggestions, i don’t care about the way i just want to show dates on the xField.

And please, like i said I’m kinda new to flex so please make your answers understandable.

Hope someone will be able to help me with this, thanks guys!

EDIT: here is the whole FLEX code:

<?xml version="1.0" encoding="utf-8"?>
<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"
               xmlns:fanpagesservice="services.fanpagesservice.*"
               width="914" height="636" minWidth="955" minHeight="600" backgroundColor="#000000"
               creationComplete="application1_creationCompleteHandler(event)">
    <fx:Script>
        <![CDATA[
            import mx.charts.events.ChartItemEvent;
            import mx.collections.ArrayCollection;
            import mx.events.FlexEvent;
            import mx.rpc.events.ResultEvent;
            [Bindable] 
            private var Totals:ArrayCollection = new ArrayCollection;
            [Bindable] 
            private var Likes:ArrayCollection = new ArrayCollection;
            [Bindable]
            public var minDate:Date = new Date(2011, 06, 1);
            [Bindable]
            public var maxDate:Date = new Date(2011, 06, 30);

            protected function ResponcerTotals_resultHandler(event:ResultEvent):void
            {
                // TODO Auto-generated method stub
                Totals = event.result as ArrayCollection;

            }

            protected function application1_creationCompleteHandler(event:FlexEvent):void
            {
                // TODO Auto-generated method stub
                ResponderTotals.token = fanpageService.getAllFanpagesTotals();

            }

            protected function ResponderLikes_resultHandler(event:ResultEvent):void
            {
                // TODO Auto-generated method stub
                Likes = event.result as ArrayCollection;
            }

            protected function totalsPie_itemClickHandler(event:ChartItemEvent):void
            {
                // TODO Auto-generated method stub
                ResponderLikes.token = fanpageService.getAllFanpagesStats(event.hitData.item.page_name);
            }

        ]]>
    </fx:Script>
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
        <fanpagesservice:FanpagesService id="fanpageService" />
        <s:CallResponder id="ResponderTotals" result="ResponcerTotals_resultHandler(event)" />

        <s:CallResponder id="ResponderLikes" result="ResponderLikes_resultHandler(event)" />
        <mx:SeriesInterpolate id="interpolate" duration="500"/>
    </fx:Declarations>
    <s:Panel x="18" y="9" width="878" height="613" backgroundColor="#262626" chromeColor="#000"
             color="#FFFFFF" contentBackgroundColor="#262626" fontFamily="Arial" fontSize="14"
             skinClass="spark.skins.spark.PanelSkin" textAlign="center">
        <s:layout>
            <s:BasicLayout/>
        </s:layout>
        <mx:PieChart id="totalsPie" x="10" y="10" itemClick="totalsPie_itemClickHandler(event)" dataProvider="{Totals}" showDataTips="true">
            <mx:series>
                <mx:PieSeries displayName="Series 1" field="likes" nameField="page_name" showDataEffect="{interpolate}"/>
            </mx:series>
        </mx:PieChart>
        <mx:Legend x="11" y="414" width="400" dataProvider="{totalsPie}"/>

        <mx:ColumnChart id="columnchart1" x="432" y="10" width="434" dataProvider="{Likes}"
                        showDataTips="true">
            <mx:series>
                <mx:ColumnSeries displayName="serie" yField="likes" xField="date" showDataEffect="{interpolate}"/>
            </mx:series>
        </mx:ColumnChart>
    </s:Panel>
</s:Application>

Basically there is a pie, when you click on a part of it it needs to show the “likes” in the column chart by dates (how much likes it got everyday). The click part works just the xField=”date” isn’t working.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T07:47:53+00:00Added an answer on May 23, 2026 at 7:47 am

    Simplest thing you can do? Sort it on the php side and send it to Flex, since you obviously know more about PHP than Flex considering you’re using the wizard to create all your Flex code.

    If you don’t want to do that, you’ll need to parse your result because your server is just sending a string as the date (not an actual Date object):

    protected function ResponderLikes_resultHandler(event:ResultEvent):void
    {
        var array:Array = ArrayCollection(event.result).source;
        // Convert string to date object
        for each(var item:Object in array)
        {
            item.timestamp = DateFormatter.parseDateString(item.date).getTime();
        }
        // Sort array
        array.sortOn('timestamp', Array.NUMERIC);
        // Insert into collection presorted
        Likes = new ArrayCollection(array);
    }
    

    That should do it, but you’ll need to the same for totals, or just create a function that parses & sorts the data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I have this code to decode numeric html entities to the UTF8 equivalent character.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.