[flexcoders] XML issues

2006-09-22 Thread jnewport
Ok, I have just wasted an entire week.and I think I am going to go
insane.  I have read every livedoc, flex doc and still no solution is
working.  

Either the issue is my XML structure (though tried several)
Or its my code or could be both.

Below are both xml structures.  What I am trying to do is use the data
(via a httpService) in BOTH a datagrid and linechart. And tie the
datagrid and linechart to a slider.  So I can map out the data for
each state on a chart for the year and then let the slider control the
months shown on the datagrid and linechart.  I can't seem to pull the
data out of the xml and use it to populate the datagrid, line chart,
and slider.  I tried e4x and bringing the data.xml file into an array
like the example Adobe dashboard example.  I would prefer not having
to parse through the xml file and create several arrays for each
region in the xml file unless I have to.  I tried the new dot
notation, but then I had issue with the slider and trying to convert
the xml object into an array to populate the slider.

What is the best format for xml and what is the easiest way to
populate the datagrid, slider, and linechart? 

[First Try XML]
list
month name=Jan-04 revenue=400263 average=80052
region name=Maine revenue=46130/
region name=Nebraska revenue=106976/
region name=Montana revenue=79554/
region name=Texas revenue=39252/
region name=Kansas revenue=128351/
/month

month name=Feb-04 revenue=379145 average=75829
region name=Maine revenue=70324/
region name=Nebraska revenue=88912/
region name=Montana revenue=69677/
region name=Texas revenue=59428/
region name=Kansas revenue=90804/
/month
/list

[Second Try  XML]
list
month name=Jan-04
state
nameMaine/name
revenue34343/revenue
/state
state
nameNebraska/name
revenue23232/revenue
/state
state
nameMontana/name
revenue6/revenue
/state
/month
month name=Feb-04
state
nameMaine/name
revenue11343/revenue
/state
state
nameNebraska/name
revenue29932/revenue
/state
state
nameMontana/name
revenue55644/revenue
/state
/month
/list






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

* To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/

* Your email settings:
Individual Email | Traditional

* To change settings online go to:
http://groups.yahoo.com/group/flexcoders/join
(Yahoo! ID required)

* To change settings via email:
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]

* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]

* Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
 




RE: [flexcoders] XML issues

2006-09-22 Thread Tracy Spratt












It is not the XML structure. Either
of those two examples would be fine.



Can you take this a step at a time?



Can you get data into a datagrid at
all? I dont do much charting, but can the line chart use the same
dataProvider that the data grid does? Hard code a sample XML
structure into an XML variable.



Structure your code so that the two controls
are bound to a global variable dataProvider, probably an XMLListCollection.
Code a function that uses an e4x _expression_ against the XML variable to set the
value of that collection (use the collection API).



The slider dataProvider needs to ba a
different var. A different e4x _expression_ can return that collection or XMLList
from the same base XML data On the change event of the slider, call the
function that uses the e4x _expression_ to set the dataProvider for the grid and
chart, filtering for the data you want.



You havent said what problems you
have been having. Or posted any code, so I cant be more specific.



What debugging techniques do you have
available?



Tracy











From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of jnewport
Sent: Friday, September 22, 2006
4:00 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] XML issues











Ok, I have just wasted an entire week.and I think
I am going to go
insane. I have read every livedoc, flex doc and still no solution is
working. 

Either the issue is my XML structure (though tried several)
Or its my code or could be both.

Below are both xml structures. What I am trying to do is use the data
(via a httpService) in BOTH a datagrid and linechart. And tie the
datagrid and linechart to a slider. So I can map out the data for
each state on a chart for the year and then let the slider control the
months shown on the datagrid and linechart. I can't seem to pull the
data out of the xml and use it to populate the datagrid, line chart,
and slider. I tried e4x and bringing the data.xml file into an array
like the example Adobe dashboard example. I would prefer not having
to parse through the xml file and create several arrays for each
region in the xml file unless I have to. I tried the new dot
notation, but then I had issue with the slider and trying to convert
the xml object into an array to populate the slider.

What is the best format for xml and what is the easiest way to
populate the datagrid, slider, and linechart? 

[First Try XML]
list
month name=Jan-04 revenue=400263
average=80052
region name=Maine
revenue=46130/
region name=Nebraska
revenue=106976/
region name=Montana
revenue=79554/
region name=Texas
revenue=39252/
region name=Kansas
revenue=128351/
/month

month name=Feb-04 revenue=379145
average=75829
region name=Maine
revenue=70324/
region name=Nebraska
revenue=88912/
region name=Montana
revenue=69677/
region name=Texas
revenue=59428/
region name=Kansas
revenue=90804/
/month
/list

[Second Try XML]
list
month name=Jan-04
state
nameMaine/name
revenue34343/revenue
/state
state
nameNebraska/name
revenue23232/revenue
/state
state
nameMontana/name
revenue6/revenue
/state
/month
month name=Feb-04
state
nameMaine/name
revenue11343/revenue
/state
state
nameNebraska/name
revenue29932/revenue
/state
state
nameMontana/name
revenue55644/revenue
/state
/month
/list






__._,_.___





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com








   






  
  
SPONSORED LINKS
  
  
  

Software development tool
  
  
Software development
  
  
Software development services
  
  


Home design software
  
  
Software development company
  

   
  






  
  Your email settings: Individual Email|Traditional 
  Change settings via the Web (Yahoo! ID required) 
  Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured 
   
Visit Your Group 
   |
  
Yahoo! Groups Terms of Use
   |
  
   Unsubscribe 
   
 

  




__,_._,___