1. Error description
Argumenterror: Error #1063: the number of parameters for basicchart/datafunc () does not match. There should be 2, currently 3. At MX. charts. chartclasses: Series/cachedefavaluvalues () [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. Error cause
<? 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. series; import MX. charts. series. items. lineseriesitem; import MX. collections. arraycollection; import MX. events. flexevent; import MX. graphics. stroke; [Bindable] // bind line chart data to private var linearray: arraycollection = new arraycollection ([{seasons: "Spring", rate: "0.48677" },{ seasons: "Summer", rate: "0.122343232" },{ seasons: "Autumn", rate: "0.5657645" },{ seasons: "Winter", rate: "0.67484889"}]);/*** set the number of digits in the line chart ratio */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); elsereturn NULL;} private function datafunc (Series: lineseries, item: Object): object {var DF: numberformatter = new numberformatter (); df. precision = "2"; df. rounding = "up"; return DF. format (item. rate);}]> </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 = "ratio" 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. Solution
Argumenterror: Error #1063: the number of parameters for basicchart/datafunc () does not match. There should be 2, currently 3.