|
Gotcha. I didn't read your post closely
enough.
I'm nut sure if you're using Flex 1.5 or 2. In Flex 1.5,
Charts don't support rendering XML data.
In Flex 2, there are two different types of XML supported
by the player. 'Classic' XML (flash.xml.XMLNode) and ECMA Standard XML. When I
say E4X, I mean ECMAScript for XML, which is the set of extensions to the
language to support XML deeply.
Charts support rendering E4X XML, but not classic XML ( in
general, unless you have really good reason, don't bother with 'classic'
XML).
I'd change your code to look something like
this:
var sXML:XML =
<data>
<item name="Aaa" val="6" /> <item name="Bbb" val="46" /> <item name="Ccc" val="16" /> </data>; chart.dataProvider = sXML.children(); // (or =
sXML..item);
Ely.
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Tuppeny Sent: Wednesday, June 21, 2006 9:22 AM To: [email protected] Subject: RE: [flexcoders] Binding chart to XML
I wasn't deliberately using E4X (I don't really know what
it is!!). I thought I was using XML! :-)
I added an @ and get the same issue:
"Property @val not found on flash.xml.XMLNode and there is
no default value."
Any ideas? From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Ely Greenfield Sent: 21 June 2006 16:54 To: [email protected] Subject: RE: [flexcoders] Binding chart to XML In E4X parlance, attributes are referred to by prefixing
their name with @. i.e., to get the val of the first item in your code,
you would write:
[EMAIL PROTECTED];
So to have a data component (chart, list, etc) pull a value
from an attribute, you need to do the same:
<PieSeries field="@val" />
Ely.
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Tuppeny Sent: Wednesday, June 21, 2006 4:11 AM To: [email protected] Subject: [flexcoders] Binding chart to XML I'm trying to bind a chart to an XML document, like this: [Inbound Mail Scanned by MessageLabs] ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ -- 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
YAHOO! GROUPS LINKS
|
- RE: [flexcoders] Binding chart to XML Ely Greenfield
- RE: [flexcoders] Binding chart to XML Tracy Spratt
- RE: [flexcoders] Binding chart to XML Daniel Tuppeny

