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进行切换的更多相关文章

  1. Flex中获取RadioButtonGroup中的RadioButton的值

    Flex中获取RadioButtonGroup中的RadioButton的值 1.设计源码 <?xml version="1.0" encoding="utf-8& ...

  2. Flex中设置Camera的视频清晰质量的最佳配合

    今天需要设置Flex中的Camera组件的一些属性,后来发现清晰度不是很高,于是捣鼓了上午半天,设置了很多的参数,竟然发现手册上就是有现成的一些设置方法,郁闷!不过我还是专门设置了几个有用和必要的属性 ...

  3. ArcGIS for Flex中引入google map作底图

    上篇文章到在ArcGIS View中引入google map,这里讲ArcGIS for Flex中引入google map作底图. 同样道理,以google map作底图,需要编写继承自TiledM ...

  4. jqGrid中实现radiobutton的两种做法

    http://blog.sina.com.cn/s/blog_4f925fc30102e27j.html   jqGrid中实现radiobutton的两种做法 ------------------- ...

  5. AS与JS相互通信(Flex中调用js函数)

    转载自http://www.blogjava.net/Alpha/archive/2009/06/27/284373.html Flex中As调用Js的方法是:     1.导入包 (import f ...

  6. SharedObject使用:在FluorineFx.net与Flex中使用共享对象维护在线用户列表实例【转】

    一.添加一个新的FluorineFx的服务类项目OnLineService,删除原有的Sample.cs,并添加一个用户类定义与一个ApplicationAdpater类:如下: /*-- User. ...

  7. Flex中NetConnection与NetStream的关系、及浏览器并发连接数测试[转]

    最近在做一个基于BS结构的视频会议系统,决定采用开源的FluorineFx.net与Flex结合的方法进行开发,前期开发都非常顺利,包括同步白板等.但到了实时视频传输的时候,原本设计是每个客户端可以显 ...

  8. Flex中 Array 的IndexOf 的作用

    Flex中 Array 的IndexOf 的作用 1.说明    indexOf用于在索引中从小到大查找,假设查得到就返回索引值,查不到就返回-1: 2.实例 (1)设计源代码 <?xml ve ...

  9. WPF的ListBox中的RadioButton不能单选问题

    WPF不知道是微软故意弄的还是真的匆忙的推出的产品,在实际开发过程中有很多小问题解决很麻烦. 今天主要说一下ListBox中使用RadioButton的时候里面的RadioButton不能单选!居然成 ...

随机推荐

  1. python 将验证码保存到本地 读取 写入

    #验证码 #读取验证码网址.打开本地路径.写入.输入验证码 downpicture = urllib.request.urlopen(SecretCodeUrl).read() local = ope ...

  2. 关于css选择器的一些细节

    1.如何区分一个html标签的不同样式 使用标签名.类名的方式解决 如果希望特别强调其中的某一个或几个元素,处理的方案有三个: 1.id选择器 2.class选择器 3.层级选择器 看下面的代码: & ...

  3. python3中的进程

    由于GIL的存在,python中的多线程并不是真正的多线程. 如果想要充分的使用多核CPU的资源,在python中大部分情况需要使用多进程. 在计算机中,进程与进程这之间在内存中是相互独立的,是两块完 ...

  4. 2017年总结的前端文章——CSS高级技巧汇总

    1. 页面顶部阴影 body:before{ content: ""; position: fixed; top:-10px; left:; width: 100%; height ...

  5. MySQL计划任务(事件调度器)(Event Scheduler)[转]

    原文链接: http://www.cnblogs.com/c840136/articles/2388512.html MySQL5.1.x版本中引入了一项新特性EVENT,顾名思义就是事件.定时任务机 ...

  6. POJ 2125 Destroying The Graph [最小割 打印方案]

    Destroying The Graph Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 8311   Accepted: 2 ...

  7. js中的this和箭头函数中的this

    一.ES6 允许使用"箭头"(=>)定义函数. // var f = v => v;// 上面的箭头函数等同于: // var f = function(v) {// ...

  8. [Python Study Notes]字符串操作

    字符串操作 a.字符串格式化输出 name = "liu" print "i am %s " % name     #输出: i am liu   PS: 字符 ...

  9. tpframe框架之slide模块的使用

    最新版git:https://gitee.com/37duman/tpframe 下载插件 点击下载slide插件 安装插件 把下载下来的插件解压后放置在addon文件夹 登录后台,点击插件管理 点击 ...

  10. Selenium常用API用法示例集----下拉框、文本域及富文本框、弹窗、JS、frame、文件上传和下载

    元素识别方法.一组元素定位.鼠标操作.多窗口处理.下拉框.文本域及富文本框.弹窗.JS.frame.文件上传和下载 元素识别方法: driver.find_element_by_id() driver ...