使用Flex的AreaChart可视化均衡分析

时间:2011-10-27 11:28:32

标签: flex

如何使用Flex的AreaChart可视化均衡分析?

1 个答案:

答案 0 :(得分:1)

这里有一个简单的例子,基于Adobe LiveDocs:

但请注意,Flex AreaSeries中存在一个错误,导致此类系列上的工具提示无法正确呈现。 AreaSeries显示项目的yField值为其高值(这是正确的),但它显示低值的相同值(AreaSeries.as的第2058行和第2083行)...

enter image description here

<?xml version="1.0"?>

<fx:Script>
    <![CDATA[

    import mx.collections.ArrayCollection;

    [Bindable]
    private var expensesAC:ArrayCollection = new ArrayCollection( [
        { Month: "Jan", Profit: 2000, Expenses: 1500, Amount: 450 },
        { Month: "Feb", Profit: 1000, Expenses: 200, Amount: 600 },
        { Month: "Mar", Profit: 1500, Expenses: 500, Amount: 300 },
        { Month: "Apr", Profit: 1800, Expenses: 1200, Amount: 900 },
        { Month: "May", Profit: 2400, Expenses: 575, Amount: 500 } ]);
    ]]>
</fx:Script>

<fx:Declarations>
    <mx:SolidColor id="sc3" color="green" alpha=".3"/>
</fx:Declarations>

    <mx:AreaChart id="Areachart" height="100%" width="100%"
         paddingLeft="5" paddingRight="5" 
         showDataTips="true" dataProvider="{expensesAC}">

        <mx:horizontalAxis>
            <mx:CategoryAxis categoryField="Month"/>
        </mx:horizontalAxis>

        <mx:series>
            <mx:AreaSeries
                yField="Profit"
                minField="Expenses"
                areaFill="{sc3}"/>
        </mx:series>
    </mx:AreaChart>