首页 新闻 会员 周边 捐助

Flex 柱状图 标签显示内容相同怎么处理?

0
悬赏园豆:50 [已关闭问题] 关闭于 2010-11-22 19:47

做Flex柱状图报表时候 参考Demo如下

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        import mx.collections.ArrayCollection;
        [Bindable]
        public var expenses:ArrayCollection = new ArrayCollection([
            {HospitalNo:"1", HospitalName:"Jan", Profit:2000, Expenses:1500},
            {HospitalNo:"2",HospitalName:"Jan", Profit:1000, Expenses:200},
            {HospitalNo:"3",HospitalName:"Mar", Profit:1500, Expenses:500}
            ]);
      </mx:Script>
    <mx:Panel title="Column Chart">
        <mx:ColumnChart id="myChart" dataProvider="{expenses}">
            <mx:horizontalAxis>
                <mx:CategoryAxis dataProvider="{expenses}"
                    categoryField="HospitalName" />
            </mx:horizontalAxis>
            <mx:series>
                <mx:ColumnSeries xField="HospitalName" yField="Profit"
                    displayName="Profit" />
                <mx:ColumnSeries xField="HospitalName" yField="Expenses"
                    displayName="Expenses" />
            </mx:series>
        </mx:ColumnChart>
        <mx:Legend dataProvider="{myChart}" />
    </mx:Panel>
</mx:Application>

当x轴绑定的是HospitalName,若HospitalName相同,则在x轴上显示数据有错误,若绑定HospitalNo 则在x轴上显示数字,不符合需求,实在没有想到好的办法,求解!

zhongweis的主页 zhongweis | 初学一级 | 园豆:30
提问于:2010-11-18 10:26
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册