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 don’t 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 haven’t said what problems you have been having. Or posted any code, so I can’t be more specific.

 

What debugging techniques do you have available?

 

Tracy

 


From: [email protected] [mailto:[email protected]] On Behalf Of jnewport
Sent: Friday, September 22, 2006 4:00 PM
To: [email protected]
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>
<name>Maine</name>
<revenue>34343</revenue>
</state>
<state>
<name>Nebraska</name>
<revenue>23232</revenue>
</state>
<state>
<name>Montana</name>
<revenue>66666</revenue>
</state>
</month>
<month name=Feb-04>
<state>
<name>Maine</name>
<revenue>11343</revenue>
</state>
<state>
<name>Nebraska</name>
<revenue>29932</revenue>
</state>
<state>
<name>Montana</name>
<revenue>55644</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

__,_._,___

Reply via email to