TypeError: Error #1006: value 不是函数。

1、错误原因

TypeError: Error #1006: value 不是函数。
	at BasicChart/dataFunc()[E:\Flash Builder\Map\src\BasicChart.mxml:68]
	at mx.charts.chartClasses::Series/cacheDefaultValues()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\Series.as:1260]
	at mx.charts.series::LineSeries/updateData()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\series\LineSeries.as:1188]
	at mx.charts.chartClasses::Series/validateData()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\Series.as:1950]
	at mx.charts.series::LineSeries/describeData()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\series\LineSeries.as:1273]
	at mx.charts.chartClasses::DataTransform/describeData()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\DataTransform.as:282]
	at mx.charts.chartClasses::AxisBase/describeData()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\AxisBase.as:238]
	at mx.charts.chartClasses::NumericAxis/get dataDescriptions()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\NumericAxis.as:1264]
	at mx.charts.chartClasses::NumericAxis/autoGenerate()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\NumericAxis.as:1281]
	at mx.charts.chartClasses::NumericAxis/updateCache()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\NumericAxis.as:974]
	at mx.charts.chartClasses::NumericAxis/update()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\NumericAxis.as:1108]
	at mx.charts.chartClasses::NumericAxis/getLabelEstimate()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\NumericAxis.as:833]
	at mx.charts::AxisRenderer/measureLabels()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\AxisRenderer.as:2056]
	at mx.charts::AxisRenderer/calcRotationAndSpacing()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\AxisRenderer.as:1701]
	at mx.charts::AxisRenderer/adjustGutters()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\AxisRenderer.as:1565]
	at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\CartesianChart.as:2182]
	at mx.charts.chartClasses::CartesianChart/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\chartClasses\CartesianChart.as:1391]
	at mx.core::UIComponent/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8531]
	at mx.managers::LayoutManager/validateDisplayList()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:663]
	at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
	at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:1072]

2、错误原因

<?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%" fontSize="12"
			   fontFamily="微软雅黑">
	<s:layout>
		<s:BasicLayout/>
	</s:layout>
	<fx:Script>
		<![CDATA[
			import mx.charts.ChartItem;
			import mx.charts.chartClasses.IAxis;
			import mx.charts.chartClasses.Series;
			import mx.charts.series.items.LineSeriesItem;
			import mx.collections.ArrayCollection;
			import mx.events.FlexEvent;
			import mx.graphics.Stroke;

			[Bindable]
			//折线图数据绑定
			private var lineArray:ArrayCollection = new ArrayCollection([
				{seasons:"春季",rate:"0.48677"},
				{seasons:"夏季",rate:"0.122343232"},
				{seasons:"秋季",rate:"0.5657645"},
				{seasons:"冬季",rate:"0.67484889"}
			]);

			/**
			 * 设置折线图中比率的位数
			 */
			public function myDataFunction(series:Series, item:Object, fieldName:String):Object
			{
				var temp:Number = item.rate;
				var number:String = formatter.format(temp);
				return number;
			}  

			public function myFillFunction(item:ChartItem, index:Number):String
			{
				var curItem:LineSeriesItem = LineSeriesItem(item);
				var num:String = formatter.format(curItem.yNumber);
				return num;
			}

			public function myFilterFunction(item:Object):String
			{
				var temp:Number = item.rate;
				var number:String = formatter.format(temp);
				return number;
			}

			public function myDataFunction1(series:Series, item:Object, fieldName:String):Object
			{
				if (fieldName == 'yValue')
					return(formatter.format(item.rate));
				else if (fieldName == "xValue")
					return(formatter.format(item.seasons));
				else
					return null;
			}

			private function dataFunc(series:LineSeries,item:Object,fieldName:String):String
			{
				var df:NumberFormatter = new NumberFormatter();
				df.precision = "2";
				df.rounding = "up";
				var temp:Number = Number(item.rate.toFixed(2));
				return df.format(temp);
			}

			private function linearAxis_labelFunc(item:Object, prevValue:Object, axis:IAxis):String
			{
				return formatter.format(item);
			}
		]]>
	</fx:Script>
	<fx:Declarations>
		<mx:NumberFormatter id="formatter" precision="2" rounding="up"/>
	</fx:Declarations>

	<mx:VBox width="100%" height="100%" paddingBottom="10" paddingLeft="10" paddingRight="15"
			 paddingTop="10" horizontalAlign="center">
		<mx:LineChart id="line" width="100%" height="90%" dataProvider="{lineArray}" showDataTips="true">
			<mx:horizontalAxis>
				<mx:CategoryAxis categoryField="seasons" displayName="四季"/>
			</mx:horizontalAxis>

			<mx:horizontalAxisRenderers>
				<mx:AxisRenderer placement="bottom" tickLength="1" tickStroke="{new Stroke(0xFF0000,1)}"
								 axisStroke="{new Stroke(0xFF0000,1)}">
					<mx:axis>
						<mx:LinearAxis id="bottomAxis"/>
					</mx:axis>
				</mx:AxisRenderer>
			</mx:horizontalAxisRenderers>

			<mx:verticalAxisRenderers>
				<mx:AxisRenderer placement="left" tickLength="1" tickStroke="{new Stroke(0xFF0000,1)}"
								 axisStroke="{new Stroke(0xFF0000,1)}">
					<mx:axis>
						<mx:LinearAxis id="leftAxis"/>
					</mx:axis>
				</mx:AxisRenderer>
			</mx:verticalAxisRenderers>

			<mx:series>
				<mx:LineSeries verticalAxis="{leftAxis}" displayName="比率" xField="seasons" yField="rate"
							  dataFunction="dataFunc"/>
			</mx:series>

			<mx:filters>
				<fx:Array/>
			</mx:filters>
		</mx:LineChart>
		<mx:Legend dataProvider="{line}"/>

	</mx:VBox>
</s:Application>

3、解决办法

时间: 2024-11-08 23:29:28

TypeError: Error #1006: value 不是函数。的相关文章

TypeError: Error #1034: 强制转换类型失败:无法将 flash.events::[email&#160;protected] 转换为 mx.events.ItemClickEvent。

1.错误描述 TypeError: Error #1034: 强制转换类型失败:无法将 flash.events::[email protected] 转换为 mx.events.ItemClickEvent. 2.错误原因 /** * 查询按钮点击函数 */ protected function search_clickHandler(event:MouseEvent):void { search.addEventListener(MouseEvent.CLICK,radiogroup_ite

TypeError: Error #1034: 强制转换类型失败:无法将 mx.controls::[email&#160;protected] 转换为 spark.core.IViewport。

1.错误描述 TypeError: Error #1034: 强制转换类型失败:无法将 mx.controls::[email protected] 转换为 spark.core.IViewport. at mx.binding::Binding/defaultDestFunc()[E:\dev\4.0.0\frameworks\projects\framework\src\mx\binding\Binding.as:270] at Function/http://adobe.com/AS3/2

TypeError:Error #1009

1.错误描述 TypeError:Error #1009:无法访问空对象引用的属性和方法 2.错误原因 3.解决办法

TypeError: Error #1034: 强制转换类型失败:无法将 &quot;0.49&quot; 转换为 mx.graphics.IFill。

1.错误描述 TypeError: Error #1034: 强制转换类型失败:无法将 "0.49" 转换为 mx.graphics.IFill. at mx.charts.series::LineSeries/updateDisplayList()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\series\LineSeries.as:1091] at mx.core::UIComponent/val

TypeError: Error #1034: 强制转换类型失败:无法将 &quot;&quot; 转换为 Array。

1.错误描述 TypeError: Error #1034: 强制转换类型失败:无法将 "" 转换为 Array. at mx.charts.series::LineSeries/updateFilter()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\series\LineSeries.as:1225] at mx.charts.chartClasses::Series/validateTransf

TypeError: Error #1009: 无法访问空对象引用的属性或方法

1.错误描述 TypeError: Error #1009: 无法访问空对象引用的属性或方法. at FirstMap/search_clickHandler()[E:\Flash Builder\Map\src\FirstMap.mxml:17] at FirstMap/__search_click()[E:\Flash Builder\Map\src\FirstMap.mxml:30] 2.错误原因 <?xml version="1.0" encoding="utf

TypeError: Error #1034: 强制转换类型失败:无法将 &amp;quot;&amp;quot; 转换为 Array。

1.错误描写叙述 TypeError: Error #1034: 强制转换类型失败:无法将 "" 转换为 Array. at mx.charts.series::LineSeries/updateFilter()[E:\dev\4.0.0\frameworks\projects\datavisualization\src\mx\charts\series\LineSeries.as:1225] at mx.charts.chartClasses::Series/validateTran

TypeError: Error when calling the metaclass bases Cannot create a consistent method resolution order (MRO) for bases A2, A1 出现原因及其解决办法

原本想测试继承,出现了这个错误: 源代码 1 class A1(object): 2 def fo1(self): 3 print "i'm A1" 4 class A2(object): 5 def fo1(self): 6 print "i'm A2" 7 class B1(A1,A2): 8 def bar(self): 9 print "i'm B1" 10 class B2(A2,A1): 11 def bar(self): 12 pr

错误 2 error C2668: “sqrt”: 对重载函数的调用不明确

原出错代码:#include "stdio.h" #include "math.h" void main() { int i=1,m,k=1; printf("请输入数字:"); scanf("%d",&m); k=sqrt(m); for(;i<k;i++) { if(m%k==0) break; } if(i>k) { printf("是素数"); } else { printf(&