PDA

View Full Version : displayName from Model


LauriL
09-26-2007, 12:28 AM
Hi!

I'm new to Flex 2 and I have a small problem regarding displayName property of the Series class. The problem is that when I want the displayName to show a value from Model, it doesn't show it. E.g. I have:

<mx:BubbleSeries displayName="title" xField="value9" yField="value8"

where title, value9 and value8 are fields from a XML file that I import using

<mx:Model id="data" source="boston_matrix.xml"/>

The chart succesfully loads the data values but not the title values (displayName). I've tried using curly braces around that as well, but that doesn't work. What to do?

Thx!

drkstr
09-26-2007, 02:12 AM
Is title an attribute or an XML string? If it's an attribute, I think you need to bind it like so:

<mx:BubbleSeries displayName="@title" xField="value9" yField="value8" />

Best Regards,
...aaron

LauriL
09-26-2007, 08:58 AM
Is title an attribute or an XML string? If it's an attribute, I think you need to bind it like so:

<mx:BubbleSeries displayName="@title" xField="value9" yField="value8" />

Best Regards,
...aaron

No, it's not an attribute, but an XML string. And I believe that if you put it that way, "@title", the result would be also that there would be only one series, titled "@title". The problem is that everything I put in quotes, makes Flex think there's only one series with that title.

Is there a way I could make an array of the XML-file's nodes? That could really help me.

Edit: I found a tip (http://www.actionscript.org/forums/showpost.php3?p=641645&postcount=5) of yours from another thread. I think I can cope with that. Anyway, thanks for help.