The property "Dataprovider" has multiple initializers. (Note: "Dataprovider" is the default property of "Mx.charts.BarChart").

Source: Internet
Author: User

1. Description of the error

The property "Dataprovider" has multiple initializers. (Note: "Dataprovider" is the default property of "Mx.charts.BarChart").


2. Cause of Error

<?

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% "CreationComplete = "Inithandler (event)" ><s:layout><s:basiclayout/></s:layout><fx:script><! [Cdata[import Mx.collections.arraycollection;import mx.events.flexevent;[ bindable]private var chartarray:arraycollection = new ArrayCollection ([{week: "Monday", Snake: "5459", Cow: "7845"},{week: " Tuesday ", Snake:" 8956 ", Cow:" 7845 "},{week:" Wednesday ", Snake:" 3562 ", Cow:" 7845 "},{week:" Thursday ", Snake:" 7856 ", Cow:" 7845 "},{week: "Friday", Snake: "1245", Cow: "7845"},{week: "Saturday", Snake: "9656", Cow: "7845"},{week: "Sunday", Snake: "6784", Cow: "7845"}]); protected function Inithandler (event:flexevent):void{}]]></fx:script><fx:declarations><!-- Place non-visual elements (such as services, value objects) here--></fx:declarations><mx:vbox width= "100%" height= "100%" horizontalalign= "center" Paddingbottom= "Ten" paddingleft= "Ten" paddingright= "paddingtop=" "><mx:barchart id=" Barchart "width=" 100% "height=" 90% "showdatatips=" True "dataprovider=" {Chartarray} "><mx:verticalaxis><mx:categoryaxis categoryfield=" Week "displayName= "Week"/></mx:verticalaxis><mx:series><mx:barseries displayname= "number of snakes" xfield= "snake" yField= "Week" /></mx:series><fx:array></fx:array></mx:barchart><mx:legend dataProvider= "{ Barchart} "/></mx:vbox></s:application>


3, the solution of the method

<?

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% "creationcomplete=" Inithandler (event) > <s:layout> <s:basicl ayout/> </s:layout> <fx:Script> <! [cdata[import mx.collections.ArrayCollection; Import mx.events.FlexEvent; [Bindable] private var chartarray:arraycollection = new ArrayCollection ([{week: "Monday", Snake: "5459", Cow: "7845"}, {week: "Tuesday", Snake: "8956", Cow: "7845"}, {week: "Wednesday", Snake: "3562", Cow: " 7845 "}, {week:" Thursday ", Snake:" 7856 ", Cow:" 7845 "}, {week:" Friday ", Snake:" 1245 ", Cow:" 7845 "}, {Week: "Saturday", Snake: "9656", Cow: "7845"}, {Week: "Sunday", Snake: "6784", Cow: "7845"}]); protected function Inithandler (event:flexevent): void {cate.ticksbetweenlabels = false; }]]> </fx:Script> <fx:Declarations> <!--place non-visual elements (such as services, value objects) here- </fx:Declarations> <mx:vbox width= "100%" height= "100%" horizontalalign= "center" Paddingbott Om= "Ten" paddingleft= "paddingright=" "paddingtop=" > <mx:barchart id= "Barchart" width= "100%" height= "90%" showdatatips= "true" dataprovider= "{Chartarray}" > <mx:verticalAxis> <mx:categoryaxis id= "Cate" categoryfield= "Week" displayname= "Week"/> </mx:verticalAxis> <mx:series> <mx:barseries displayname= "Number of snakes" xfield= "snake" yfield= "Week"/&G T </mx:series> <mx:secondverticalaxis> <mx:categoryaxis categoryfield= "Week" displayname= "Week"/> </mx:secondve rticalaxis> <mx:secondSeries> <mx:lineseries displayname= "OX" Xfiel d= "cow" yfield= "Week"/> </mx:secondSeries> </mx:BarChart> < Mx:legend dataprovider= "{barchart}"/> </mx:VBox> </s:Application>



The property "Dataprovider" has multiple initializers. (Note: "Dataprovider" is the default property of "Mx.charts.BarChart").

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.