Mark P.
Mark P.

Reputation: 282

Flex 4, dynamic chart

How can I create a dynamic chart with multiple series when my XML looks like this and the number of series nodes could be more or less depending on the data.

<root><series id="Americas" name="Americas">
<item total="2" year="2011" month="April" fullDate="April 2011"/>
<item total="3" year="2011" month="February" fullDate="February 2011"/>
<item total="2" year="2011" month="March" fullDate="March 2011"/></series><series id="Asia-Pacific" name="Asia-Pacific">
<item total="2" year="2011" month="April" fullDate="April 2011"/>
<item total="1" year="2011" month="January" fullDate="January 2011"/>
<item total="1" year="2011" month="March" fullDate="March 2011"/></series><series id="EMEIA" name="EMEIA">
<item total="1" year="2011" month="April" fullDate="April 2011"/>
<item total="1" year="2011" month="February" fullDate="February 2011"/>
<item total="3" year="2011" month="March" fullDate="March 2011"/></series><series id="Global" name="Global">
<item total="3" year="2011" month="April" fullDate="April 2011"/>
<item total="3" year="2011" month="March" fullDate="March 2011"/></series></root>

Upvotes: 1

Views: 807

Answers (1)

Jason Towne
Jason Towne

Reputation: 8050

Perhaps this example could help you. From his post:

Using arrays as objects in my dataProvider (of type ArrayCollection), I am able to dynamically add and remove key / value pairs to or from that array.

He also includes the example's source code for you to take a look at.

Upvotes: 2

Related Questions