Flex中的FusionCharts 四图监听
<?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 四图监听的更多相关文章
- 关于JAVA中事件分发和监听机制实现的代码实例-绝对原创实用
http://blog.csdn.net/5iasp/article/details/37054171 文章标题:关于JAVA中事件分发和监听机制实现的代码实例 文章地址: http://blog.c ...
- Android 开发中的View事件监听机制
在开发过程中,我们常常根据实际的需要绘制自己的应用组件,那么定制自己的监听事件,及相应的处理方法是必要的.我们都知道Android中,事件的监听是基于回调机制的,比如常用的OnClick事件,你了解它 ...
- Flex中的FusionCharts 2D饼图
1.设计思路 (1)FusionCharts中有Flex组件文件FusionCharts.swc,这样可以让FusionCharts用Flex展示出来: (2)利用xmlns:components=& ...
- Flex中的FusionCharts 2D面积图
Flex中的FusionCharts 2D面积图 1.源码 <?xml version="1.0" encoding="utf-8"?> <s ...
- Flex中的FusionCharts 2D折线图
Flex中的FusionCharts 2D折线图 1.设计源码 LineChart.mxml: <?xml version="1.0" encoding="utf- ...
- Flex中配置FusionCharts
Flex中配置FusionCharts 1.配置前说明 (需要的工具和插件) 1.1 MyEclipse10.0 1.2 Flash Builder4.0 1.3 FusionCharts ...
- onscroll事件没有响应的原因以及vue.js中添加onscroll事件监听的方法
1 onscroll事件失效 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> ...
- Android应用中返回键的监听及处理
MainActivity: package com.testnbackpressed; import android.os.Bundle; import android.view.KeyEvent ...
- Android应用中Back键的监听及处理
MainActivity如下: package cn.testnbackpressed; import android.os.Bundle; import android.view.KeyEvent; ...
随机推荐
- 小白入门Docker基础篇
docker是什么 百科上的解释是这样的: Docker 是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的容器中,然后发布到任何流行的 Linux 机器上,也可以实现虚拟化 ...
- c#代码启动任务管理器的几种方法
1.直接启动 ProcessStartInfo info = new ProcessStartInfo(); info.FileName = Path.Combine(Environment.GetE ...
- HDU [P1704] Rank
传递闭包裸题 但是本题的Floyd一定要优化,不然会T cpp #include <iostream> #include <cstdio> #include <cstri ...
- ionic2 +Angular 使用自定义图标
结合阿里巴巴矢量图标库实现在ionic2开发中使用自定义图标. step1:在阿里巴巴图标管理中新建项目,并添加自己选中的图标到购物车: step2:将购物车中的图标"添加至项目" ...
- c# 利用IMap 收取163邮件
最近我要做一个爬虫.这个爬虫需要如下几个步骤: 1 填写注册内容(需要邮箱注册) 2 过拖拽验证码(geetest) 3 注册成功会给邮箱发一封确认邮箱 4 点击确认邮箱中的链接 完成注册 我这里就采 ...
- 备忘录之 —— .bashrc(IC工具篇)
好久没有使用这些IC工具了,装在自己的虚拟机中的Linux系统里面,现在想要卸载掉,想起之前自己辛辛苦苦的折腾这些工具配置,如果直接删除,感觉未免有点对不起自己的劳动成果,或许以后再也用不到了,就当是 ...
- docker cs50 ide 安装
ECS上搭建Docker(CentOS7): https://help.aliyun.com/document_detail/51853.html docker官方文档: https://docs.d ...
- Java经典编程题50道之四十
将几个字符串排序(按英文字母的顺序). public class Example40 { public static void main(String[] args) { Stri ...
- TensorFlow4Delphi
https://github.com/hartmutdavid/TensorFlow4Delphi
- 1.4 random模块
Python中的random模块用于生成随机数,下面介绍一下random模块中最常用的几个函数. 国际惯例,用模块之前先导入: >>> import random (一)random ...