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. 在ubtunu使用apt-get安装和配置freeradius

    安装freeradius之前先要确保已经安装了mysql.因为后来要用到.没有安装使用apt-get来安装 apt-get install mysql-server 然后就是安装freeradius的 ...

  2. Java高并发的常见应对方案

    Java高并发的常见应对方案 一.关于并发我们说的高并发是什么? 在互联网时代,高并发,通常是指,在某个时间点,有很多个访问同时到来. 高并发,通常关心的系统指标与业务指标? QPS:每秒钟查询量,广 ...

  3. git stash暂存文件

    git stash 可用来暂存当前正在进行的工作, 比如想pull 最新代码,但又不想提交代码.先git stash暂存,pull之后,用git stash pop或者git stash apply取 ...

  4. 洛谷 [P2764]最小路径覆盖问题

    二分图应用模版 #include <iostream> #include <cstdio> #include <algorithm> #include <cs ...

  5. BZOJ 3456: 城市规划 [多项式求逆元 DP]

    题意: 求出n个点的简单(无重边无自环)无向连通图数目.方案数mod 1004535809(479 * 2 ^ 21 + 1)即可. n<=130000 DP求方案 g(n) n个点所有图的方案 ...

  6. BZOJ 1069: [SCOI2007]最大土地面积 [旋转卡壳]

    1069: [SCOI2007]最大土地面积 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 2978  Solved: 1173[Submit][Sta ...

  7. LeetCode - 690. Employee Importance

    You are given a data structure of employee information, which includes the employee's unique id, his ...

  8. virsh 常用操作

    virsh list 显示在运行的 虚拟机    virsh list --all 显示在运行和停止的虚拟机    ssh 192.168.0.115 通过网络连接子机   如果没有网络 可以通过 v ...

  9. [SCOI2009][bzoj1025]游戏

    [SCOI2009][bzoj1025]游戏 标签: DP 置换 题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1025 题解 很套路的题目 ...

  10. Ubuntu16.04下的NetCore环境搭建

    跨平台系列汇总:http://www.cnblogs.com/dunitian/p/4822808.html#linux VSCode安装:http://www.cnblogs.com/dunitia ...