1、3D饼图设计源码

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

			import org.osmf.events.TimeEvent;

			[Bindable]
			/*数据源绑定*/
			private var pieArray:ArrayCollection = new ArrayCollection([
				{label:"一月",value:"891541"},
				{label:"二月",value:"451542"},
				{label:"三月",value:"784455"},
				{label:"四月",value:"698988"},
				{label:"五月",value:"321545"},
				{label:"六月",value:"154512"},
				{label:"七月",value:"265455"},
				{label:"八月",value:"98988"},
				{label:"九月",value:"784544"},
				{label:"十月",value:"987844"},
				{label:"十一月",value:"356522"},
				{label:"十二月",value:"894556"}
			]);

			[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"},
				{showPercentValues:"1"},
				{baseFontColor:"#FF0000"},
				{showValue:"1"},
				{startingAngle:"90"}
			]);

		]]>
	</fx:Script>
	<mx:HBox width="100%" height="100%" id="hbox">
		<components:FusionCharts width="100%" height="100%" FCChartType="Pie3D">
		    <components:FCChartData FCData="{pieArray}" FCParams="{params}" id="pieData"/>
		</components:FusionCharts>
	</mx:HBox>
</s:Application>

2、设计结果

Flex中的FusionCharts 3D饼图-LMLPHP

04-27 03:27