flex图表数据动态更新效果示例
<?xml version="1.0"?>
<!-- charts/BasicSeriesSlideEffect.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
[Bindable]
public var expenses1:ArrayCollection=new ArrayCollection([{Month: "Jan", Income: 2000, Expenses: 1500}, {Month: "Feb", Income: 1000, Expenses: 200}, {Month: "Mar", Income: 1500, Expenses: 500}]);
[Bindable]
public var expenses2:ArrayCollection=new ArrayCollection([{Month: "Jan", Income: 1200, Expenses: 800}, {Month: "Feb", Income: 2500, Expenses: 300}, {Month: "Mar", Income: 575, Expenses: 490}]);
public var year:int=1;
public function changeProvider():void
{
if (year == 2)
{
myChart.dataProvider=expenses1;
b1.label="View Second Year Data";
lbl.text="First Year Data";
year=1;
}
else
{
myChart.dataProvider=expenses2;
lbl.text="Second Year Data";
b1.label="View First Year Data";
year=2;
}
}
]]-->
</mx:Script>
<!-- Define chart effects -->
<mx:SeriesSlide id="slideIn"
duration="1000"
direction="up"/>
<mx:SeriesSlide id="slideOut"
duration="1000"
direction="down"/>
<mx:Panel title="Column Chart with Basic Series Slide Effect"
layout="absolute"
height="493">
<mx:Label id="lbl"
text="First Year Data"
width="233.5"
height="44"
fontSize="24"
color="#091D96"
top="5"
right="10"/>
<mx:ColumnChart id="myChart"
dataProvider="{expenses1}">
<mx:horizontalAxis>
<mx:C
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- http://blog.flexexamples.com/2007/09/04/adding-animations-and-effects-to-flex-tool-tips/ -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertic ......
<![CDATA[
Flex中的键盘事件
要在Flex中响应键盘输入,只需注册keyDown事件即可。
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" keyDown="OnKeyDown(event)">
<mx:Script>
......
/**
* @author:ycccc8202
* @用途:注册事件进行传递参数的代理类
* @date:2007.8.26
* @example:
* import com.ycccc.utils.JEventDelegate
stage.addEventListener(MouseEvent.MOUSE_DOWN,JEventDelegate.create(mouseDownHandler,"a","b"));
function mouseDownHandler(e:MouseEvent,...arg) {
trace(e)
......
<?xml version="1.0"?>
<!-- charts/StandardEffectTriggers.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="init()">
<mx:Script>
<!--[CDATA[
import mx.collections.ArrayCollection;
import mx ......