I advise setting resultFormat=”e4x”, doing away with binding into the mx:Model, and instead using a result handler handler to assign the result directly to an instance/global XML variable.

 

This way, you can trace the contents of event.result.toXMLString(), and see exactly what you have in Flex.

 

Mx:Model converts the xml into a nested mx:Object structure.  Dumping its content is harder than toXMLString().

 

If you need a collection for a list-based control dataProvider, use an e4x selection _expression_ to return an XMLList, and wrap that in an XMLListCollection.

 

Tracy

 


From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com] On Behalf Of dataknife
Sent: Wednesday, November 01, 2006 3:39 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] XML charting troubles

 

All, I'm a Flex Newbie - coming from the Java world (nice to not have
to use JSP's any more!).. I'm having a problem with of a basic XML to
Chart nature: I can't get it to work! I've followed the example in the
help- I just seem to be missing a detail..

The XML output from my server looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<healthcheck site="SLFTEST" date="Wed Nov 01 12:10:38 PST 2006">
<lagdataset>
<lagdata><date>10-24-2006 19:00</date><lag>13.860</lag></lagdata>
<lagdata><date>10-25-2006 12:00</date><lag>12.110</lag></lagdata>
<lagdata><date>10-25-2006 19:00</date><lag>15.800</lag></lagdata>
</lagdataset>
</healthcheck>

The MXML looks like this:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute" creationComplete="feedRequest.send()">

<mx:HTTPService
id="feedRequest"

url="" href="http://localhost:8080/HealthCheckServer/xmlOutput.do?site=SLFTEST">http://localhost:8080/HealthCheckServer/xmlOutput.do?site=SLFTEST"
useProxy="false"
showBusyCursor="true"/>

<mx:Model id="data" >
{feedRequest.result.healthcheck.lagdataset.lagdata}
</mx:Model>

<mx:Panel x="10" y="10" width="711" height="594" layout="absolute">
<mx:TabNavigator x="10" y="10" width="671" height="544"
visible="true" styleName="myTabs">
<mx:Panel id="syshealth" label="System Health" width="100%"
height="100%">
<mx:VDividedBox height="50%" width="646">
<mx:HDividedBox width="100%">
<mx:VBox height="100%">
<mx:LineChart id="txnLag" dataProvider="{data}" width="316"
height="154" showDataTips="true">
<mx:toolTip>Transaction Lag is the difference between the
Creation and Processing times for a Transaction</mx:toolTip>
<mx:horizontalAxis>
<mx:CategoryAxis dataProvider="{data}"
categoryField="date"/>
</mx:horizontalAxis>
<mx:series>
<mx:LineSeries displayName="Lag" yField="lag" />

</mx:series>
</mx:LineChart>

</mx:VBox>
</mx:HDividedBox>
</mx:VDividedBox>

</mx:Panel>
<mx:Panel id="afcinfo" label="AFC Information" width="100%"
height="100%">
</mx:Panel>
</mx:TabNavigator>
</mx:Panel>

</mx:Application>

When I run the MXML, it complains about a missing element lag...

Can someone spare some time to help me?

SF

__._,_.___

--
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