加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

Flex中的FusionCharts 2D折线图

发布时间:2020-12-15 03:47:32 所属栏目:百科 来源:网络整理
导读:? Flex中的FusionCharts 2D折线图 1、设计源码 LineChart.mxml: ?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" w

?Flex中的FusionCharts 2D折线图


1、设计源码

LineChart.mxml:

<?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:BasicLayout/>
	</s:layout>
	<fx:Declarations>
		<!-- 将非可视元素(例如服务、值对象)放在此处 -->
	</fx:Declarations>
	
	<fx:Script>
		<![CDATA[
			import com.events.FCEvent;
			
			import mx.collections.ArrayCollection;
			import mx.controls.Alert;
			
			[Bindable]
			/*2D柱形图数据源*/
			private var lineArray:ArrayCollection = new ArrayCollection([
				{label:"星期一",value:"7845"},{label:"星期二",value:"9845"},{label:"星期三",value:"1542"},{label:"星期四",value:"5645"},{label:"星期五",value:"4875"},{label:"星期六",value:"3215"},{label:"星期日",value:"9887"}
			]);
			
			[Bindable]
			/*2D柱形图数据源*/
			private var paramsArray:ArrayCollection = new ArrayCollection([
				{baseFontSize:"12"},{caption:"2013年某桥某周通过的人数统计"},{showBorder:"1"},{borderColor:"#00FF00"},{bgColor:"#495898"},{baseFontColor:"#FF0000"},{showValue:"1"},{numDivLines:"8"},{divLineIsDashed:"1"},{formatNumber:"0"},{showAlternateHGridColor:"1"}
			]);

			/*点击事件函数*/
			protected function clickHandler(event:FCEvent):void
			{
				Alert.show(event.param);
			}

		]]>
	</fx:Script>
	
	<components:FusionCharts FCChartType="Line" width="100%" height="100%" FCClickEvent="clickHandler(event)">
		<components:FCChartData FCData="{lineArray}" FCParams="{paramsArray}"
								ChartNoDataText="无数据" >
			<components:FChTrendLines/>
	    </components:FCChartData>
	</components:FusionCharts>
</s:Application>

2、设计结果

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读