I'm not sure how you're going to stipulate a yField that doesn't exist
in the dataprovider.

If you have control over the XML format, add the additional attribute to
each datapoint item.

If you don't, then you'll need to take what you're given and add the
yVal attribute to each item.

Jeff

-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of wreedijk
Sent: Friday, June 27, 2008 2:36 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Charting - setting yField property for a
PlotSeries when dataProvider is XML


I am trying to create a PlotChart with series (y is constant) from an
XML object that is defined as follows:

<series yVal='Weight'>
  <dataPoint date='12/01/2004'/> 
  <dataPoint date='12/25/2004'/>
  <dataPoint date='1/1/2005'/>
  <dataPoint date='1/22/2005'/>
</series>

I want the xField to be derived from the date attribute in the dataPoint
- no problem. I want the yField to be based on the yVal attribute in the
series (parent of the dataPoints) element. How can I do this?

<mx:PlotSeries 
  dataProvider="{weightSeries.dataPoint}" 
  xField="@date" 
  yField=   ?? What do I put here ?? 
/>
There must be a way. Please help! Thanks

THE FOLLOWING WORKS but I don't want to have to repeat the y value in
every data point.

<series>
  <dataPoint date='12/01/2004' yVal='Weight'/> 
  <dataPoint date='12/25/2004' yVal='Weight'/>
  <dataPoint date='1/1/2005' yVal='Weight'/>
  <dataPoint date='1/22/2005' yVal='Weight'/>
</series>

<mx:PlotSeries 
  dataProvider="{weightSeries.dataPoint}" 
  xField="@date" 
  yField="@yVal"
/>



------------------------------------

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



Reply via email to