[flexcoders] Re: Need Help understanding ModuleManager or Why isn't the chart drawing?

2009-07-17 Thread todd.bruner
Yes, the trace statements show that the data is returned from the webservice, 
and that the parsing is occurring as expected.  The two panels are drawn, 
however the titles are not set.  The chart draws an X and Y axis but not actual 
data plotted.

Thanks,
Todd

--- In flexcoders@yahoogroups.com, Alex Harui aha...@... wrote:

 Does the Chart end up with a dataProvider with items in it?  Do the trace 
 statements show that data got returned and parsed?
 
 Alex Harui
 Flex SDK Developer
 Adobe Systems Inc.http://www.adobe.com/
 Blog: http://blogs.adobe.com/aharui
 




[flexcoders] Need advise on how to display multiple SWF apps

2009-02-16 Thread todd.bruner
I have developed a small flex charting app that displays a graph based
on xml returned from a web service.  Works great.  Now I want to
display many of these charts in a single interface.  The idea is to
have 3 or so of these charts in a horizontal line say C1, C2, C3.  At
a time interval or a click event from the user, I'd like to shift C1
off screen  to the left, Shift C2 to C1's former location, C3 to C2's
former location and finally add C4 to C3's former location.  (and the
reverse if the user clicks the to the right).  I'm open to doing
this with JavaScript/HTML or inside another FLEX application.

I thought I saw a demo (with source) once that had something similar
where each picture in a gallery was a flash movie and you could
walk through the gallery.  Unfortunately, my googling has not turned
that up again.  

Can anyone point me to an example that I could extrapolate from?  I'm
 new to flex programming so I apologize if this something I should
just know how to do.  (pointers on where to learn that, appreciated
as well.)

Thanks in advance for any help or pointers.

Todd



[flexcoders] Re: Data not appearing in AdvancedDataGrid

2008-12-05 Thread todd.bruner
Alex:

Thanks so much for the links!  I think they will be a tremendous help.

Todd


--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 I've often had to look at multiple examples to figure out what I need
 to do for a project. Here are a few places to try, the first one
 having some code that matches your scenario,
  - http://www.adobe.com/devnet/flex/quickstart/accessing_xml_data/
 (scroll down for the datagrid example; same thing can be used for
the ADG)
  - http://www.adobe.com/devnet/flex/quickstart/httpservice/
  - http://www.bpurcell.org/blog/index.cfm?mode=entryentry=1020
  - http://learn.adobe.com/wiki/display/Flex/2b.+Code+Files
 
 - Alex
 




[flexcoders] Re: Data not appearing in AdvancedDataGrid

2008-12-05 Thread todd.bruner
Tracy:

Thanks for taking the time to reply.
I was wishing to display something like:

period
 2008-12-5 00:00:00|  |
   |  CK  | 101
   |  US  | 33
   |  UK  | 10
 2008-12-5 01:00:00|  |
   |  PB  | 5
   |  CA  | 14
   |  IT  | 200
...etc...

I will explore your other suggestions below...Thanks!

Todd

--- In flexcoders@yahoogroups.com, Tracy Spratt [EMAIL PROTECTED] wrote:

 What are you wanting in your display?
 
  
 
 A straight table with three columns: period, ccode, and detects?
 
  
 
 If so, then that is not hierarchical and you are making this more
 complicated than it is.  Why did you choose ADG instead of plain old
 DataGrid?
 
  
 
 If your issue is accessing data nested in subnodes, then use a
 labelFunction.
 
  
 
 Make the dataProvider = xmlData.rollup (an XMLList. If you plan to
 undate it programatically, then wrap it in an XMLListCollection).  The
 labelFunction can reach down into any node of rollup you want
 
  
 
 Tracy
 




[flexcoders] Re: Data not appearing in AdvancedDataGrid

2008-12-05 Thread todd.bruner
I'm starting to make some progress with your help.  I've changed my
xml output and incorporated Alex and Tracy's suggestions.  I can now
see data in the ADG but its not quite what I expected.  Here's the 
what I get:

Period   Country Detects
2008-12-04 03:00:00  PHGBMYDK121341022
2008-12-04 04:00:00  AUGBMY  39211

The Source XML is:
dashboard
 rollup period=2008-12-04 03:00:00
  country code=PH detects=12 /
  country code=GB detects=134 /
  country code=MY detects=102 /
  country code=DK detects=2 /
 /rollup
 rollup period=2008-12-04 04:00:00
...
 /rollup
/dashboard

My MXML fragrements of interest are:

mx:AdvancedDataGrid 
id=myDataGrid
dataProvider={statFeed.rollup}
width=50% 
height=75%
verticalCenter=0 left=0
  mx:AdvancedDataGridColumn headerText=Period  dataField=@period/
  mx:AdvancedDataGridColumn headerText=Country
labelFunction=getCountryCode/
  mx:AdvancedDataGridColumn headerText=Detects
labelFunction=getCountryDetects/
/mx:AdvancedDataGrid

The functions getCountryDetects and getCountryCode are the same as
your label function (changed to appropriate label names.)

What I want is that each rollup period have a spinner that contains
a row for each country that displays the detects during that period.
For example, using the above data:

Period:   Country   Detects
* 2008-12-04 03:00:00
  PH12
  GB134

Many thanks for all the help...
   

--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 You'd probably want to use a labelFunction on each column where you
 want to do something to what the user sees. I think one of the links I
 sent you has info on creating labelFunctions. Here's an example,
 
 // As described here: http://thanksmister.com/?p=8
 // Pulls data from XML nodes that are optional. 
 // Assumes your XML has an element called image that
 // has an attribute called id.
 public function getImageID(item:Object,
 column:AdvancedDataGridColumn):String {
   if (item.image == undefined) {
 return null;
   }
   else {
 return [EMAIL PROTECTED];
   }
 }
 
 In your ADG, you'd call this function like this:
 
 mx:AdvancedDataGridColumn labelFunction=getImageID 
   headerText=Image ID /
 
 -Alex
 




[flexcoders] Re: Data not appearing in AdvancedDataGrid

2008-12-05 Thread todd.bruner
I tried something different and got it to work.  Thanks for all your
help.  For others searching, here's what I did. For those following
the thread, if there's a better way to do this, I welcome your
suggestions.  (got the idea to try it this way from Programming Flex
3. Kazoun, Lott)

relevant MXML snippets:

// as code that process the HTTPService return)
private function statResultHandler(event:ResultEvent):void
{
statFeed = event.result as XML;
var statCollection:ArrayCollection = new ArrayCollection;
for each (var rollup:XML in statFeed.children()) {
var period:String = [EMAIL PROTECTED];
for each (var country:XML in rollup.country) {
var code:String = [EMAIL PROTECTED];
var detects:int = [EMAIL PROTECTED];
statCollection.addItem({
rollup: period,
country: code,
quantity: detects
 });
}
}
statGrouping = new GroupingCollection();
statGrouping.source = statCollection;
var grouping:Grouping = new Grouping();
grouping.fields = [new GroupingField(rollup)];
statGrouping.grouping = grouping; 
statGrouping.refresh();
}
 
The ADG mxml:

mx:AdvancedDataGrid 
id=myDataGrid
dataProvider={statGrouping}
width=50% 
height=75%
verticalCenter=0 left=0
mx:groupedColumns
mx:AdvancedDataGridColumn headerText=Period  
dataField=@period/
mx:AdvancedDataGridColumn headerText=Country 
dataField=country/
mx:AdvancedDataGridColumn headerText=Detects 
dataField=quantity/
/mx:groupedColumns
/mx:AdvancedDataGrid


--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 Look up flex itemRenderer on Google. I think that will enable you to
 customize the component that displays the rollup column. Within the
 itemRenderer, you'd want to do an override of the set data() function. 
 
 -Alex
 




[flexcoders] Data not appearing in AdvancedDataGrid

2008-12-04 Thread todd.bruner
Hello and thanks in advance for any help you can provide this flex
newbie.

I'm trying to create a simple AdvancedDataGrid that displays XML data
from a web service I wrote.  The XML file looks like:

dashboard
 rollup
period2008-12-03 01:00:00/period
period_sse1228266000/period_sse
country
ccodePH/ccode
detects1/detects
/country
country
 ccodeGB/ccode
 detects50/detects
/country
 /rollup
 rollup
  period2008-12-04 03:00:00/period
  period_sse1228359600/period_sse
  country
   ccodePH/ccode
   detects18/detects
  /country
 /rollup
/dashboard

My Flex 3  MXML app is:

?xml version=1.0 encoding=utf-8?
mx:Application xmlns:mx=http://www.adobe.com/2006/mxml;
layout=absolute
 creationComplete=init()
 mx:Script
 ![CDATA[
 import mx.collections.ArrayCollection;
 import mx.rpc.events.ResultEvent;
 import mx.rpc.events.FaultEvent;
 import mx.controls.Alert;

 [Bindable] public var dataServiceURL:String =
http://dashboard-dev/cgi-bin/dataService.pl?type=countrystats;;
 [Bindable] public var chartValues:ArrayCollection;

 public function init():void
 {
 countries_rpc.send();
 }
 public function handle_xml(event:ResultEvent):void
 {
 var xmlData:XML = event.result as XML;
 var newData:Array = parseXmlToArray(xmlData);
 chartValues = new ArrayCollection(newData);
  }

 public function handle_fault(event:FaultEvent):void
 {
 Alert.show(event.fault.faultString, Error);
 }

 private function parseXmlToArray(xmlData:XML):Array
 {
 var newData:Array = new Array();

 for each (var rollup:XML in xmlData.rollup) {
 var carray:Array = new Array();
 for each (var country:XML in rollup.country) {
 carray.push({
 ccode: country.ccode,
 detects: country.detects
 });
 }
 carray.sortOn(ccode);
 newData.push({
 period: rollup.period,
 period_msse: rollup.period_sse*1000,
 children: carray
 });
 }
 newData.sortOn(period_msse);
 return newData;
 }
 ]]
 /mx:Script
 mx:HTTPService id=countries_rpc url={dataServiceURL}
   result=handle_xml(event); fault=handle_fault(event);
resultFormat=e4x /

 mx:AdvancedDataGrid id=countrystatgrid width=50% height=50%
 mx:dataProvider
 mx:HierarchicalData source={chartValues}  /
 /mx:dataProvider
 mx:columns
 mx:AdvancedDataGridColumn dataField=period /
 mx:AdvancedDataGridColumn dataField=ccode /
 mx:AdvancedDataGridColumn dataField=detects /
 /mx:columns
 /mx:AdvancedDataGrid
/mx:Application

When I run this the AdvancedDataGrid is displayed but no data is shown. 
In the debugger, I can see chartValues and the data from the webservice
appears to be correctly stuffed into it.

Can anyone point me in the right direction? Thanks!
Todd




[flexcoders] Re: Data not appearing in AdvancedDataGrid

2008-12-04 Thread todd.bruner
Alex:

Thank you for your suggestions.  I stuffed the raw XML into a TextArea
and it looks fine and matches what I get requesting the same url in my
web browser.

The reason I'm fussing with array/arraycollection is ignorance.  I'm
trying to adapt things from various examples I've seen.  I'm trying to
do as you suggest bind directly, however, I'm not sure I'm doing that
right either.

I agree with you about keeping it simple...unfortunately, that's what
I thought I was doing! :-)  

So given the my xml format, how do I bind it to the ADG?  All the
examples I can find use objects and HeirachicalData.  If anyone can
point me towards an example, I'll take from there.

Thanks!

--- In flexcoders@yahoogroups.com, oneworld95 [EMAIL PROTECTED] wrote:

 Two things: 
  - Try stuffing the raw XML into a TextArea to see what it looks like.
 You could bind it directly to the ADG without first converting to
 array/arraycollection; that's the beauty of the e4x format you're
 using on the HTTPService call. Not sure why you're doing the
 conversion to an array and then to an arraycollection. If you need to
 modify the values when they're displayed, try using the labelFunction
 on each column. 
  - When I run into issues in code, I try to make it as simple as
 possible, make sure that works, then add the additional pieces back in
 one by one until I can see what's causing it to act funny. 
 
 I'm thinking something's not quite right with the data after you
 manipulate it. Look at that piece.
 
 -Alex