How do I display grouped XML data in a Flex pie chart?

Posted by mclaughlinj on Stack Overflow See other posts from Stack Overflow or by mclaughlinj
Published on 2010-06-09T21:32:59Z Indexed on 2010/06/10 3:03 UTC
Read the original article Hit count: 417

Filed under:
|

I've looked into grouping XML data with GroupingCollections and AdvancedDataGrids, but I can't figure out how to display that data in a chart.

Basically, what I want to do is group the data by the category field, which should give me two rows under red, one under blue, and one under green. When inputting this data into the pie chart, it should take up the right amount of space (1/2 for red, 1/4 each for blue and green). I don't need the other_data field, as I'd like to use the group name (category in this case) as the callout.

Any suggestions?

Sample data:

<row>
  <category>red</category>
  <other_data>this shouldn't really matter</other_data>
</row>
<row>
  <category>blue</category>
  <other_data>this shouldn't really matter</other_data>
</row>
<row>
  <category>red</category>
  <other_data>this shouldn't really matter</other_data>
</row>
<row>
  <category>green</category>
  <other_data>this shouldn't really matter</other_data>
</row>

© Stack Overflow or respective owner

Related posts about Xml

Related posts about flex