Adobe flex creates a vertical line chart.

Adobe flex creates a vertical line chart.

Postby haretu » Wed Mar 23, 2011 10:31 am

Adobe flex creates a vertical line chart.
Code: Select all
<?xml version="1.0"?>
<!-- charts/VerticalLineChart.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
  <mx:Script><![CDATA[
     import mx.collections.ArrayCollection;
     [Bindable]
     public var expenses:ArrayCollection = new ArrayCollection([
        {Month:"Jan", Profit:2000, Expenses:1100},
        {Month:"Feb", Profit:1800, Expenses:1055},
        {Month:"Mar", Profit:1200, Expenses:800},
        {Month:"Apr", Profit:1400, Expenses:900},
        {Month:"May", Profit:1400, Expenses:1150},
        {Month:"Jun", Profit:1340, Expenses:600},
        {Month:"Jul", Profit:1600, Expenses:950},
        {Month:"Aug", Profit:1500, Expenses:1140},
        {Month:"Sep", Profit:1800, Expenses:1200},
        {Month:"Oct", Profit:2000, Expenses:1280},
        {Month:"Nov", Profit:2400, Expenses:1300},
        {Month:"Dec", Profit:1500, Expenses:500}
     ]);
  ]]></mx:Script>
  <mx:Panel title="Vertical Line Chart">
     <mx:LineChart id="myChart"
        dataProvider="{expenses}"
        showDataTips="true"
     >
        <mx:verticalAxis>
           <mx:CategoryAxis
                dataProvider="{expenses}"
                categoryField="Month"
           />
        </mx:verticalAxis>
        <mx:series>
           <mx:LineSeries
                xField="Profit"
                yField="Month"
                displayName="Profit"
                sortOnXField="false"
           />
           <mx:LineSeries
                xField="Expenses"
                yField="Month"
                displayName="Expenses"
                sortOnXField="false"
           />
        </mx:series>
     </mx:LineChart>
     <mx:Legend dataProvider="{myChart}"/>
  </mx:Panel>
</mx:Application>
Attachments
Screen shot 2011-03-23 at 10.31.40 AM.png
Screen shot 2011-03-23 at 10.31.40 AM.png (45.83 KiB) Viewed 694 times
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm

Return to Adobe FLEX Flash

Who is online

Users browsing this forum: No registered users and 1 guest

cron