1 Reply Latest reply on Mar 22, 2011 2:39 AM by Tanu Jain

    XML as dataProvider for Charts

    Arul pugazh

           I want to display XML exported from Oracle Database as a chart......


      The xml has the following structure :



















      I've seen many chart examples using ArrayCollection as DataProvider . using the same way , i tried to set xml . But no results.


      Can you please suggest me how to set an XML as dataprovider ? ( or XMLList or XMLlistcollection )


      ( i'm developing a small app in AIR )

        • 1. Re: XML as dataProvider for Charts
          Tanu Jain

          Sample app from Adobe's livedocs:



              <result month="Jan-04">
              <result month="Feb-04">



          <?xml version="1.0"?>
          <!-- charts/XMLFileDataProvider.mxml -->
          <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
            <mx:Model id="results" source="../assets/data.xml"/>
            <mx:Panel title="Line Chart">
               <mx:LineChart id="myChart" dataProvider="{results.result}" showDataTips="true">
                     <mx:CategoryAxis categoryField="month"/>
                     <mx:LineSeries yField="banana" displayName="Banana"/>
                     <mx:LineSeries yField="apple" displayName="Apple"/>
                     <mx:LineSeries yField="orange" displayName="Orange"/>
               <mx:Legend dataProvider="{myChart}"/>