Flex中通过RadioButton进行切换
1、页面切换
<?xml version="1.0" encoding="utf-8"?> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" width="100%" height="100%"> <s:layout> <s:BasicLayout/> </s:layout> <fx:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> </fx:Declarations> <fx:Script> <![CDATA[ import mx.collections.ArrayCollection; /** * 图的数据源绑定 */ [Bindable] private var chartArray:ArrayCollection = new ArrayCollection([ {week:"星期一",apple:"451245",orange:"894544",peach:"451245"}, {week:"星期二",apple:"985444",orange:"745445",peach:"989565"}, {week:"星期三",apple:"124544",orange:"323565",peach:"323121"}, {week:"星期四",apple:"895645",orange:"201212",peach:"542121"}, {week:"星期五",apple:"325645",orange:"564545",peach:"656454"}, {week:"星期六",apple:"564512",orange:"784545",peach:"845455"}, {week:"星期日",apple:"784545",orange:"656232",peach:"124545"} ]); /** * RadioButton 点击事件 */ protected function clickHandler(event:Event):void { if(radio_column.enabled) { column.height = 450; line.height = 0; } else if(radio_line.enabled) { column.height = 0; line.height = 450; } } ]]> </fx:Script> <mx:VBox id="vbox" width="100%" height="100%"> <mx:VBox id="column_chart" width="100%" height="80%" paddingLeft="10" paddingRight="10" paddingTop="10"> <mx:ColumnChart id="column" showDataTips="true" dataProvider="{chartArray}" width="100%" height="450"> <mx:horizontalAxis> <mx:CategoryAxis categoryField="week" displayName="星期"/> </mx:horizontalAxis> <mx:series> <mx:ColumnSeries displayName="苹果" xField="week" yField="apple"/> <mx:ColumnSeries displayName="橘子" xField="week" yField="orange"/> <mx:ColumnSeries displayName="桃子" xField="week" yField="peach"/> </mx:series> </mx:ColumnChart> <mx:Legend dataProvider="{column}"/> </mx:VBox> <mx:VBox id="line_chart" width="100%" height="0" paddingLeft="10" paddingRight="10" paddingTop="10"> <mx:LineChart id="line" showDataTips="true" dataProvider="{chartArray}" width="100%" height="100%"> <mx:horizontalAxis> <mx:CategoryAxis categoryField="week" displayName="星期"/> </mx:horizontalAxis> <mx:series> <mx:LineSeries displayName="苹果" xField="week" yField="apple"/> <mx:LineSeries displayName="橘子" xField="week" yField="orange"/> <mx:LineSeries displayName="桃子" xField="week" yField="peach"/> </mx:series> </mx:LineChart> <mx:Legend dataProvider="{line}"/> </mx:VBox> <mx:HBox width="100%" height="30"> <mx:RadioButton id="radio_column" name="chart" label="柱形图" click="clickHandler(event)"/> <mx:RadioButton id="radio_line" name="chart" label="折线图" change="clickHandler(event)"/> </mx:HBox> </mx:VBox> </s:Application>
2、页面结果
Flex中通过RadioButton进行切换的更多相关文章
- Flex中获取RadioButtonGroup中的RadioButton的值
Flex中获取RadioButtonGroup中的RadioButton的值 1.设计源码 <?xml version="1.0" encoding="utf-8& ...
- Flex中设置Camera的视频清晰质量的最佳配合
今天需要设置Flex中的Camera组件的一些属性,后来发现清晰度不是很高,于是捣鼓了上午半天,设置了很多的参数,竟然发现手册上就是有现成的一些设置方法,郁闷!不过我还是专门设置了几个有用和必要的属性 ...
- ArcGIS for Flex中引入google map作底图
上篇文章到在ArcGIS View中引入google map,这里讲ArcGIS for Flex中引入google map作底图. 同样道理,以google map作底图,需要编写继承自TiledM ...
- jqGrid中实现radiobutton的两种做法
http://blog.sina.com.cn/s/blog_4f925fc30102e27j.html jqGrid中实现radiobutton的两种做法 ------------------- ...
- AS与JS相互通信(Flex中调用js函数)
转载自http://www.blogjava.net/Alpha/archive/2009/06/27/284373.html Flex中As调用Js的方法是: 1.导入包 (import f ...
- SharedObject使用:在FluorineFx.net与Flex中使用共享对象维护在线用户列表实例【转】
一.添加一个新的FluorineFx的服务类项目OnLineService,删除原有的Sample.cs,并添加一个用户类定义与一个ApplicationAdpater类:如下: /*-- User. ...
- Flex中NetConnection与NetStream的关系、及浏览器并发连接数测试[转]
最近在做一个基于BS结构的视频会议系统,决定采用开源的FluorineFx.net与Flex结合的方法进行开发,前期开发都非常顺利,包括同步白板等.但到了实时视频传输的时候,原本设计是每个客户端可以显 ...
- Flex中 Array 的IndexOf 的作用
Flex中 Array 的IndexOf 的作用 1.说明 indexOf用于在索引中从小到大查找,假设查得到就返回索引值,查不到就返回-1: 2.实例 (1)设计源代码 <?xml ve ...
- WPF的ListBox中的RadioButton不能单选问题
WPF不知道是微软故意弄的还是真的匆忙的推出的产品,在实际开发过程中有很多小问题解决很麻烦. 今天主要说一下ListBox中使用RadioButton的时候里面的RadioButton不能单选!居然成 ...
随机推荐
- 使用jdbc存储图片和大文本
package cn.itcast.i_batch; import java.sql.Connection; import java.sql.PreparedStatement; import jav ...
- html的标签
<a>:anchor 定义锚 <abbr>:abbreviation 定义缩写 <acronym>: 定义只取消首字母的缩写 <address>:定义地 ...
- vsftp 的安装及配置
安装vsftpd 直接用 yum安装,方便的很 yum -y install vsftpd #进入vsftpd目录cd /etc/vsftpd/ #Create The Virtual Users D ...
- ABP官方文档翻译 6.5 内嵌资源文件
内嵌资源文件 介绍 创建内嵌文件 xproj/project.json形式 csproj形式 添加内嵌资源管理器 使用内嵌视图 使用内嵌资源 ASP.NET Core 配置 忽略文件 重写内嵌文件 介 ...
- MySQL索引之B+树
MySQL索引大都存储在B+树中,除此还有R树和hash索引.B+树的基础还是B树. B树由2部分组成,节点和索引.下面将构建一个B树,每个节点存2个数据,每个节点有前,中,后三个索引.插入数字的顺序 ...
- CF585E. Present for Vitalik the Philatelist [容斥原理 !]
CF585E. Present for Vitalik the Philatelist 题意:\(n \le 5*10^5\) 数列 \(2 \le a_i \le 10^7\),对于每个数\(a\) ...
- stat,fstat,lstat三者区别
fstat ,lstat,stat; 头文件:#include<sys/stat.h> #include<sys/types.h> #include<unistd.h&g ...
- mac 上node.js环境的安装与测试
如果大家之前做过web服务器的人都知道,nginx+lua与现在流行的Node.js都是可以做web服务器的,前者在程序的写法和配置上要比后者麻烦,但用起来都是差不多.在这里建议大家如果对lua脚本语 ...
- table内容强制换行
为防止文字过长而撑坏表格,一般我们需要通过css使td中内容强制换行.分别给table和td加一条样式即可实现: <meta charset="utf-8"> < ...
- Android Stutio 3.0 - Gradle sync failed
0.Android Studio 权威教程 (url:http://blog.csdn.net/column/details/zsl-androidstudio.html) 1. 项目老是报错: Gr ...