2011-05-10 62 views
1

當我的XML看起來像這樣,根據數據,系列節點的數量可能更多或更少時,如何創建包含多個系列的動態圖表。Flex 4,動態圖表

<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> 

回答

2

也許this example可以幫助你。從他的崗位:

使用數組作爲我 數據提供程序的對象(類 的ArrayCollection的),我能夠 動態添加和刪除鍵/值對 或從該數組。

他還包括示例的source code供您查看。

+0

這看起來真不錯,謝謝! – 2011-05-10 23:45:22