Skip navigation
don.pruitt
Currently Being Moderated

Chart doesn't display in Tabbed application

May 23, 2012 8:46 AM

Tags: #flash_builder #chart #flex_mobile #4.6

I am beand new to Flex Builder and am running into a problem that I just can't seem to figure out.  I created a view-based application following the process outlined by Michael Chaize in his Flex 4 Dashboard video (with the exception that I am retrieving data from a Microsoft Web API REST Service rather than PHP).  With some minor changes (to get data into the Array Collection), it works perfectly and my chart displays in the emulator (iPad).  Great.  Flex is cool.

 

Next I decided to experiment with a tabbed application.  I added a view with the exact same code and the chart deosn't display.  I debugged the application and all of the variables have the same data as in the basic dashboard I successfully created.  The service is being called.  The array is being populated.  and the data source has the data, but no chart displays.

 

What am I missing?  Do I have to do something differently when creating a tabbed application?  Note:  I put a Text Area and Text box on the view and am able to populate the text area with the xml from the service as well as specific items from the array.

 

Thanks in advance for any help you can provide.  I am quickly becoming a Flex fan (vs. Silverlight), but I am really confused by this issue!

 

Thanks,

 

Don

 
Replies
  • Currently Being Moderated
    May 23, 2012 10:53 AM   in reply to don.pruitt

    Check the sizes and positions of the chart and all of its parents.

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 5:07 PM   in reply to don.pruitt

    The chart is probably in a container in a contentGroup in the skin of the Tabbed Application.  If you can’t see it, it or one of its parent containers is either sized at zero width/height  or moved somewhere off-screen.  Usually we see zero width/height somewhere.

     

    Set up a mouse handler on the app like

        click=”dumpSIzes()”

     

    Where

     

        function dumpSizes()

        {

            var p:DIsplayObject = chart;

            while (p)

            {

                trace(p.width, p.height);

                p = p.parent;

            }

        }

     
    |
    Mark as:
  • Currently Being Moderated
    May 23, 2012 9:34 PM   in reply to don.pruitt

    So I assume piechart1 isn’t showing up in the tabbed app?

     

    Add a click handler to the view and modify the code in my previous reply to start with piechart1 instead of chart and see what gets output to the console.

     

    -Alex

     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2012 8:48 AM   in reply to don.pruitt

    Is it just the chart that doesn’t show up or the TextArea and Label as well?

     
    |
    Mark as:
  • Currently Being Moderated
    May 24, 2012 9:28 AM   in reply to don.pruitt

    OK.  Then it probably can’t be a parent problem.  Did you prove it has valid data in its dataprovider?  Maybe some weird thing causes the DP to be un-set.

     

    Also make sure other chart properties look ok.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points