Stock data wrapped in XML and referenced by XMLListCollection : XMLListCollection « Data Model « Flex






Stock data wrapped in XML and referenced by XMLListCollection

Stock data wrapped in XML and referenced by XMLListCollection
 
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" backgroundColor="white">
    <mx:XML id="DataXML">
        <stockdata>
            <ticker>
                <data interval="09/01/2010" high="54" low="40" open="53" close="43" />
                <data interval="09/02/2010" high="69" low="37" open="62" close="40" />
                <data interval="09/04/2010" high="65" low="30" open="60" close="52" />
                <data interval="09/05/2010" high="60" low="20" open="42" close="48" />
                <data interval="09/03/2010" high="62" low="52" open="55" close="60" />
                <data interval="09/04/2010" high="65" low="30" open="60" close="52" />
                <data interval="09/05/2010" high="60" low="20" open="42" close="48" />
                <data interval="09/01/2010" high="54" low="40" open="53" close="43" />
                <data interval="09/02/2010" high="69" low="37" open="62" close="40" />
                <data interval="09/03/2010" high="62" low="52" open="55" close="60" />
            </ticker>
        </stockdata>
    </mx:XML>
    <mx:XMLListCollection source="{DataXML.ticker.data}" id="stockData" />
    <mx:Panel title="Stock" width="500" height="200" layout="horizontal">
        <mx:CandlestickChart id="hlocChart" dataProvider="{stockData}" height="100%" width="100%">
            <mx:horizontalAxis>
                <mx:CategoryAxis categoryField="@interval" />
            </mx:horizontalAxis>
            <mx:series>
                <mx:CandlestickSeries highField="@high" lowField="@low" openField="@open" closeField="@close" />
            </mx:series>
        </mx:CandlestickChart>
    </mx:Panel>
</mx:Application>

   
  








Related examples in the same category

1.Feeding the Tree XML dataFeeding the Tree XML data
2.XMLListCollection component sourcing XML