Flex柱状图问题

weichenggao 2011-10-27 09:06:14
大家好,请问用flex画柱状图,可以把柱子分成上下两个部分吗?
柱子的长度表示库存总量,上面的表示未使用部分,下面的表示已使用部分。

flex很强大,感觉应该能支持这个,有经验的同事帮看看。
...全文
386 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
weichenggao 2012-04-04
  • 打赏
  • 举报
回复
http://blog.csdn.net/savidyang/article/details/6409582
http://hanyi366.iteye.com/blog/1452625
<!-- -->
以下设置的timeout都是30分钟,不同的设置方法有不同的参数时间单位,请大家小心。

用代码对flex的session_timeout设置: //时间单位为“毫秒”
FlexContext.getFlexSession().setTimeoutPeriod(30*60*1000);
用代码对flex的flexclient_timeout设置: //时间单位为“毫秒”
FlexContext.getFlexClient().setTimeoutPeriod(30*60*1000);
用代码对http的session_timeout设置: //时间单位为“秒”
http_session.setMaxInactiveInterval(30*60);
对某个项目的session_timeout设置在servler.xml或context.xml文件中: //时间单位为“分钟”
<Context path="/test" docBase="/test" defaultSessionTimeOut="30"/>
对服务器的session_timeout设置在web.xml文件中: //时间单位为“分钟”
<session-config>
<session-timeout>30</session-timeout>
</session-config>
weichenggao 2012-03-13
  • 打赏
  • 举报
回复
httpd /home/httpd目录
weichenggao 2011-11-23
  • 打赏
  • 举报
回复
Flex session和HTTP session过期时间(timeout)的设置

以下设置的timeout都是30分钟,不同的设置方法有不同的参数时间单位,请大家小心。


用代码对flex的session_timeout设置: //时间单位为“毫秒”
FlexContext.getFlexSession().setTimeoutPeriod(30*60*1000);


用代码对flex的flexclient_timeout设置: //时间单位为“毫秒”
FlexContext.getFlexClient().setTimeoutPeriod(30*60*1000);


用代码对http的session_timeout设置: //时间单位为“秒”
http_session.setMaxInactiveInterval(30*60);


对某个项目的session_timeout设置在servler.xml或context.xml文件中: //时间单位为“分钟”
<Context path="/test" docBase="/test" defaultSessionTimeOut="30"/>


对服务器的session_timeout设置在web.xml文件中: //时间单位为“分钟”
<session-config>
<session-timeout>30</session-timeout>
</session-config>
SWQQ- 2011-10-30
  • 打赏
  • 举报
回复
混合住可以显示的。
weichenggao 2011-10-30
  • 打赏
  • 举报
回复
.<?xml version="1.0" encoding="utf-8"?>
2.<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="top"
3. horizontalAlign="center" backgroundGradientColors="[0x000000,0x323232]" paddingTop="0" viewSourceURL="srcview/index.html">
4.
5. <mx:Script>
6. <![CDATA[
7.
8. import mx.collections.ArrayCollection;
9.
10. [Bindable]
11. private var medalsAC:ArrayCollection = new ArrayCollection( [
12. { Country: "USA", Gold: 35, Silver:39, Bronze: 29 },
13. { Country: "China", Gold: 32, Silver:17, Bronze: 14 },
14. { Country: "Russia", Gold: 27, Silver:27, Bronze: 38 } ]);
15. ]]>
16. </mx:Script>
17.
18. <mx:Panel title="ColumnChart Control" layout="horizontal" color="0xffffff" borderAlpha="0.15" width="600" height="240"
19. paddingTop="10" paddingRight="5" paddingBottom="10" paddingLeft="5" horizontalAlign="center">
20.
21. <mx:ColumnChart type="stacked" id="column" height="100%" color="0x323232"
22. showDataTips="true" dataProvider="{medalsAC}" >
23.
24. <mx:horizontalAxis>
25. <mx:CategoryAxis categoryField="Country"/>
26. </mx:horizontalAxis>
27.
28. <mx:series>
29. <mx:ColumnSeries xField="Country" yField="Gold" displayName="Gold"/>
30. <mx:ColumnSeries xField="Country" yField="Silver" displayName="Silver"/>
31. <mx:ColumnSeries xField="Country" yField="Bronze" displayName="Bronze"/>
32. </mx:series>
33. </mx:ColumnChart>
34.
35. <mx:Legend dataProvider="{column}" color="0x323232"/>
36.
37. </mx:Panel>
38.</mx:Application>

type="overlaid"

假设数据源如下

public var finance:ArrayCollection=new ArrayCollection([
{Month:"一月",In:200,Out:150},
{Month:"二月",In:200,Out:150},
{Month:"三月",In:200,Out:150},
{Month:"四月",In:200,Out:150},
{Month:"五月",In:200,Out:150},
{Month:"六月",In:200,Out:150},
{Month:"七月",In:200,Out:150},
{Month:"八月",In:200,Out:150},
{Month:"九月",In:200,Out:150},
{Month:"十月",In:200,Out:150},
{Month:"十一月",In:200,Out:150},
{Month:"十二月",In:200,Out:150},
])



type 。可以控制将每个月的 In 和Out数据显示在同一个柱状图上。官方解释:

Possible values are:

"clustered": Values from different series are grouped by category. This is the default type. 默认样式 "overlaid": Multiple values are rendered on top of one another by category, with the last series on top.将一个图放在另一个上面,后加入的series放上面 "stacked": Columns are stacked on top of each other and grouped by category. Each column represents the cumulative value of the columns beneath it. 将图形堆积起来,图形的原点都是从0开始, "100%": Columns are stacked on top of each other, adding up to 100%. Each column represents the percent that it contributes to the sum of the values for that category 百分比

columnWidthRatio 柱状图的宽度 默认值0.65

labelPosition 柱状图的标签显示位置

4,328

社区成员

发帖
与我相关
我的任务
社区描述
多媒体/设计 Flex
社区管理员
  • Flex
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧