Flex: PieChart LabelFunction

Categories: Flex; Tagged with: ; @ March 4th, 2010 14:54

使用labelFunction 直接显示PieChart的信息, 如下代码定义一个PieChart:

		
					
						
					
				
				

其labelFunction:

		/** 过期分布PieChart的LabelFunction.  */
		protected static function labelFunForChartExpDEtail(item:Object, field:String, index:Number, percentValue:Number):String {
			var percentString:String = percentValue.toString().substr(0, 5);
			return UserQualStatistics.getTypeLabel(item.type) + ":" + "\n" + RM.getString(BUNDLE_DASHBOARD, "info.total") + ":" + item.total + "(" + percentString + "%)";
		}

效果:

 

image



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.