<?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%" creationComplete="initHandler()"
			    xmlns:components="com.fusioncharts.components.*">
	<s:layout>
		<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
	</s:layout>
	<fx:Declarations>
		<!-- 将非可视元素(例如服务、值对象)放在此处 -->
	</fx:Declarations>

	<fx:Script>
		<![CDATA[
			import com.events.FCEvent;
			import com.fusioncharts.components.FusionCharts;

			import mx.collections.ArrayCollection;
			import mx.controls.Alert;

			[Bindable]
			/*数据源绑定*/
			private var pieArray:ArrayCollection = new ArrayCollection([
				{label:"一月",value:"891541",link:"S-1"},
				{label:"二月",value:"451542",link:"S-2"},
				{label:"三月",value:"784455",link:"S-3"},
				{label:"四月",value:"698988",link:"S-4"},
				{label:"五月",value:"321545",link:"S-5"},
				{label:"六月",value:"154512",link:"S-6"},
				{label:"七月",value:"265455",link:"S-7"},
				{label:"八月",value:"98988",link:"S-8"},
				{label:"九月",value:"784544",link:"S-9"},
				{label:"十月",value:"987844",link:"S-10"},
				{label:"十一月",value:"356522",link:"S-11"},
				{label:"十二月",value:"894556",link:"S-12"}
			]);

			[Bindable]
			/*饼图属性绑定*/
			private var params:ArrayCollection = new ArrayCollection([
				{baseFontSize:"12"},
				{caption:"2013年某桥每月通过的人数统计"},
				{showBorder:"1"},
				{borderColor:"#00FF00"},
				{bgColor:"#000000"},
				{showLegend:"1"},
				{legendShadow:"1"},
				{legendAllowDrag:"1"},
				{dashed:"1"},
				{showToolTip:"1"},
				{legendNumColumns:"6"},
				{baseFontColor:"#FF0000"},
				{showValue:"1"},
				{startingAngle:"90"}
			]);

            /**
			 * 初始化函数
			 */
			protected function initHandler():void
			{
				var FC:FusionCharts = new FusionCharts();
				FC.FCChartType = "Pie2D";
				FC.FCData(pieArray);
				FC.percentWidth = 100;
				FC.percentHeight = 100;
				pie.addChild(FC);
				FC.addEventListener("FCClickEvent",clickPie);
			}

			private function clickPie(evt:FCEvent):void
			{
				Alert.show(evt.param);
				column.removeAllChildren();
				var FC:FusionCharts = new FusionCharts();
				FC.FCChartType = "Column2D";
				FC.FCData(pieArray);
				FC.percentWidth = 100;
				FC.percentHeight = 100;
				column.addChild(FC);
				FC.addEventListener("FCClickEvent",clickColumn);
			}

			private function clickColumn(evt:FCEvent):void
			{
				Alert.show(evt.param);
				line.removeAllChildren();
				var FC:FusionCharts = new FusionCharts();
				FC.FCChartType = "Line";
				FC.FCData(pieArray);
				FC.percentWidth = 100;
				FC.percentHeight = 100;
				line.addChild(FC);
				FC.addEventListener("FCClickEvent",clickLine);
			}

			private function clickLine(evt:FCEvent):void
			{
				Alert.show(evt.param);
				bar.removeAllChildren();
				var FC:FusionCharts = new FusionCharts();
				FC.FCChartType = "Bar2D";
				FC.FCData(pieArray);
				FC.percentWidth = 100;
				FC.percentHeight = 100;
				bar.addChild(FC);
			}

		]]>
	</fx:Script>

	<mx:HBox width="100%" height="50%">
		<mx:HBox width="50%" height="100%" id="pie">

		</mx:HBox>
		<mx:HBox width="50%" height="100%" id="column">

		</mx:HBox>
	</mx:HBox>
	<mx:HBox width="100%" height="50%">
		<mx:HBox width="50%" height="100%" id="line">

		</mx:HBox>
		<mx:HBox width="50%" height="100%" id="bar">

		</mx:HBox>
	</mx:HBox>
</s:Application>

Flex中的FusionCharts 四图监听的更多相关文章

  1. 关于JAVA中事件分发和监听机制实现的代码实例-绝对原创实用

    http://blog.csdn.net/5iasp/article/details/37054171 文章标题:关于JAVA中事件分发和监听机制实现的代码实例 文章地址: http://blog.c ...

  2. Android 开发中的View事件监听机制

    在开发过程中,我们常常根据实际的需要绘制自己的应用组件,那么定制自己的监听事件,及相应的处理方法是必要的.我们都知道Android中,事件的监听是基于回调机制的,比如常用的OnClick事件,你了解它 ...

  3. Flex中的FusionCharts 2D饼图

    1.设计思路 (1)FusionCharts中有Flex组件文件FusionCharts.swc,这样可以让FusionCharts用Flex展示出来: (2)利用xmlns:components=& ...

  4. Flex中的FusionCharts 2D面积图

    Flex中的FusionCharts 2D面积图 1.源码 <?xml version="1.0" encoding="utf-8"?> <s ...

  5. Flex中的FusionCharts 2D折线图

    Flex中的FusionCharts 2D折线图 1.设计源码 LineChart.mxml: <?xml version="1.0" encoding="utf- ...

  6. Flex中配置FusionCharts

    Flex中配置FusionCharts 1.配置前说明 (需要的工具和插件) 1.1   MyEclipse10.0 1.2   Flash Builder4.0 1.3   FusionCharts ...

  7. onscroll事件没有响应的原因以及vue.js中添加onscroll事件监听的方法

    1 onscroll事件失效 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...

  8. Android应用中返回键的监听及处理

    MainActivity: package com.testnbackpressed;  import android.os.Bundle;  import android.view.KeyEvent ...

  9. Android应用中Back键的监听及处理

    MainActivity如下: package cn.testnbackpressed; import android.os.Bundle; import android.view.KeyEvent; ...

随机推荐

  1. C语言对函数操作的结果声明

    可以用来返回给调用者函数操作的状态值. /* 这是一份关于函数返回值定义的头文件. */ #ifndef _STATUS_H_ #define _STATUS_H_ #define STATUS in ...

  2. python面向对象编程之组合

    前面讲了面向类与对象的继承,知道了继承是一种什么"是"什么的关系. 然而类与类之间还有另一种关系,这就是组合 先来看两个例子: 先定义两个类,一个老师类,老师类有名字,年龄,出生的 ...

  3. Go笔记-指针

    Go 语言的取地址符是 &,放到一个变量前使用就会返回相应变量的内存地址 一个指针变量可以指向任何一个值的内存地址 它指向那个值的内存地址,在 32 位机器上占用 4 个字节,在 64 位机器 ...

  4. 洛谷 [P2765] 魔术球问题

    贪心做法 每次尽可能选择已经放过球的柱子 #include <iostream> #include <cstdio> #include <cstring> #inc ...

  5. 洛谷 [P1314] 聪明的质检员(NOIP2011 D2T2)

    ###一道二分答案加前缀和### 题目中已经暗示的很明显了 "尽可能靠近" " 最小值" 本题的主要坑点在于 long long 的使用 ##abs函数不支持l ...

  6. CentOS上安装GitBlit服务

    简单介绍 在上一篇文章中,已经简单的介绍了如何在CentOS的服务器上搭建git服务器.但是这种方式实现的服务器功能比较弱,操作起来也比较繁琐.在网上搜索了一圈,感觉Gitblit比较符合我的需求.接 ...

  7. 随机手机号和身份证号码(python)

    在使用selenium2 python自动化过程中,用户添加的时候程序设置的手机号和身份证号码是唯一的,这方面python代码可以实现,以下是调试成功,可以实现的. 具体代码如下 身份证需要下载dis ...

  8. git服务器配置http请求

    使用apache 配置http协议的git库 在CentOS上基于Apache http服务搭建git远程仓库(一) 基于http方式的git服务器搭建 搭建http协议的git服务器 Linux g ...

  9. 分享:Python中的位运算符

    按位运算符是把数字看作二进制来进行计算的.用的不太多,简单了解. 下表中变量 a 为 60,b 为 13二进制格式如下: a = 0011 1100 b = 0000 1101 a&b = 0 ...

  10. haproxy下X-Frame-Options修复方法

    X-Frame-Options是网页常见漏洞之一,在其他的frame下加载你网页的内容,达到劫持的目的. 修复方法很简单,在http 请求投中添加X-Frame-Options参数.网上可以查一下Ap ...