0 Replies Latest reply on Apr 12, 2011 5:45 PM by new2oop

    how do I create a line chart direct from xml or convert xml to ArrayCollection

    new2oop Level 1

      The xml is simple:

       

      <data>

      <row name="Q1">

      <expenses>64</expenses>

      <revenue>98</revenue>

      <profit>34</profit>

      </row>

      <row name="Q2">

      <expenses>44</expenses>

      <revenue>28</revenue>

      <profit>64</profit>

      </row>

      <row name="Q3">

      <expenses>14</expenses>

      <revenue>58</revenue>

      <profit>54</profit>

      </row>

      </data>

       

      it's dynamically generated as a string so could be created in xml format, or ArrayCollection, or any other format that works. However I can't find a example of using xml as the datasource that works. I've tried to convert it to an ArrayCollection first but that didn't work either.

       

      Alternatively I could store the data as a string "Month: "May", Profit: 2400, Expenses: 575, Amount: 456", then:

       

      expensesAC2.addItem({Month: "May", Profit: 2400, Expenses: 575, Amount: 456 });

       

      works but:

       

      var settings:String = resultXML.row[0];

      expensesAC2.addItem({settings});

       

      doesn't work. Any suggestions, or links to a tutorial that works would be really appreciated?