易截截图软件、单文件、免安装、纯绿色、仅160KB

flex 图表使用百分比示例

<?xml version="1.0"?>
<!-- charts/PredefinedAxisStyles.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">

<mx:Script>
<!--[CDATA[
//导入相关包
import mx.collections.ArrayCollection;
import mx.charts.*;
import mx.charts.series.items.ColumnSeriesItem;
import mx.charts.ChartItem;
import mx.charts.chartClasses.Series;
import mx.charts.chartClasses.IAxis;
import mx.utils.ObjectUtil;

[Bindable]
public var expenses:ArrayCollection = new ArrayCollection([
{Month:"*", Profit:20, Expenses:15},
{Month:"**", Profit:10, Expenses:20},
{Month:"***", Profit:30, Expenses:40},
{Month:"****", Profit:15, Expenses:25},
{Month:"*****", Profit:40, Expenses:45}
]);



public function myLabelFormat(obj:Object,pcat:Object,ax:LinearAxis):String
{
return numForm.format(obj)+"%";
}

private function setCustomLabel(element:ChartItem, series:Series):String {
// Get a refereence to the current data element.
var data:ColumnSeriesItem = ColumnSeriesItem(element);

// Get a reference to the current series.
var currentSeries:ColumnSeries = ColumnSeries(series);

// Create a return String and format the number.
return numForm.format(data.yNumber) + "%";
}


// This method customizes the values of the axis labels.
// This signature (with 4 arguments) is for a CategoryAxis.
public function defineLabel(
cat:Object,
pcat:Object,
ax:CategoryAxis,
labelItem:Object):String
{
// Show contents of the labelItem:
for (var s:String in labelItem) {
trace(s + ":" + labelItem[s]);
}

// Return the customized categoryField value:
//return cat + "";

return '<font size="35"><font color="#ff0000">' + cat + '</font></font>';
//'<font color="#ff0000">'


相关文档:

Flex BlazeDS Message Service

 消息服务(Message Service )提供发布(publish)/订阅(subscribe)机制允许Flex 应用程序发布消息、订阅消息终端(messaging destination),从而实现实时数据的推和协作。
  一、Message Service
  Message Service 提供发布(publish)/订阅(subscribe)机制允许Flex 应用程序发布消息、订阅消息终端(messaging des ......

flex画图形示例

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
creationComplete="doDraw()"
backgroundColor="#d6d4d4" backgroundGradientColors="[#FFFFFF, #FFFFFF]">
<mx:Canvas id="paper"
x="30"
y="24"
......

flex学习日志

*****************************************************
1-0. 安装配置工作环境
*****************************************************
1.安装jdk1.6
设置环境变量:java_home,内容为jdk安装后jdk所在目录,不是jre目录
2.安装tomcal 6.0到d:\
3.安装myeclipse 6.5
4.安装firefox及插件
  安装firefox
&nbs ......

Flex例子 通过继承增加新的功能

Flex中通过继承可以为新组件增加新的功能,如通过注入方法,改变背景色,改变位置和高度等。这里主要掌握原组件的一些特性,属性和方法,以便根据需要的功能加以覆写(也可以自己扩展),达到自己想要的效果。下面是一个简单的例子
1、新建MyDataGrid.as,继承DataGrid,覆写drawRowBackground方法,注入rowColorFunction方 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号