I have an xml file that I get through an http serivce:
<mx:HTTPService id="nodeChannels" url="{url}"
result="onResultHttpService(event)" resultFormat="e4x"/>
I then use onResultHttpService to load the xml file into an XML list
collection
private function onResultHttpService( avResultEvent :ResultEvent ):void
{
lvXmlList= (avResultEvent.result as XML).point;
mvXmlListCollection = new XMLListCollection(
lvXmlList );
}
The XML file is as follows:
<data>
<point tick="7981" timestamp="0-0-0T00:00:00.0">
<channel number="1">8190</channel>
<channel number="2">8190</channel>
</point>
<point tick="7982" timestamp="0-0-0T00:00:00.0">
<channel number="1">8190</channel>
<channel number="2">8190</channel>
</point>
<point tick="7983" timestamp="0-0-0T00:00:00.0">
<channel number="1">8190</channel>
<channel number="2">8190</channel>
</point>
</data>
I want to be able to plot the channels with respect to the tick attribute in
the point node. So, if I were to be using a line series, the first point
for channel 1 is (7981, 8190) and (7981,8190) for channel 2 - since they
both have the same value.
I want to plot this data using a line series:
<!-- Begin Graphing -->
<mx:LineChart id="DataChart" width="100%" height="95%" alpha="1.0">
<mx:series>
<mx:LineSeries id="c1" displayName="Channel 1"
dataProvider="{mvXmlListCollection}" yField="" xField="@tick"/>
<mx:LineSeries id="c2" displayName="Channel 2"
dataProvider="{mvXmlListCollection}" yField="" xField="@tick"/>
</mx:series>
</mx:LineChart>
Here's the problem: I can get the xaxis values to be defined as the value of
the tick attribute in the point node. I, however, am unable to plot the
channel amplitude with respect to the tick. What do I need to type for the
yField value in order to access a specific channel (such as
lvXmlList.channel.(@number=="1"))?
Thanks.
Rich
--
View this message in context:
http://www.nabble.com/Plot-Using-XML-Attributes-tf4876273.html#a13953381
Sent from the FlexCoders mailing list archive at Nabble.com.