| Home | Tutorials | Forums | Articles | Blogs | Movies | Library | Employment | Press | Buy templates |
|
|
#1 |
|
Registered User
Join Date: May 2006
Posts: 2
|
Hello, everybody! I have recently started to work with FLEX and I am having some problems with the showing of effects in barcharts when using Legends.
Basically, if I don't define a Legend for my barchart, the "SeriesSlide" Effect works properly. However, if I set the dataProvider for the Legend, the effect no longer appears. The code is shown below. The data itself is not included, but I think that only with the script the problem will be spotted by those with more experience in Flex. I thank you all already! <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml"> <mx:Script> <![CDATA[ import com.xfactorstudio.xml.xpath.*; import mx.charts.AxisRenderer; import comp.*; static var xml_doc = new XML(); var asPath:String; function loadData(){ _global.asPath = "data.xml"; xml_doc.ignoreWhite = true; xml_doc.onLoad = function(success){ if (success){ _root.initComponents(); _root.defineLegend(); } else { alert("Error while loading XML document"); } } xml_doc.load(_global.asPath); } function initComponents(){ mPanel0.title = "Panel0"; var query1 = "/units/datasection/chart3/months"; var data1:Array = XPath.selectNodes(xml_doc,query1); var dp1:Array = _root.createDataProvider(data1); barchart1.dataProvider = dp1; barchart1.horizontalAxis.dataProvider = dp1; barchart1.verticalAxis.dataProvider = dp1; barchart1.series[0].showDataEffect = "Effect1"; barchart1.series[0].hideDataEffect = "Effect2"; barchart1.series[0].name = "name"; barchart1.horizontalAxisRenderer.title = "title1"; barchart1.verticalAxisRenderer.title = "title2"; } function defineLegend(){ legend1.dataProvider = "barchart1"; } ]]> </mx:Script> <mx:Effect> <mx:SeriesSlide direction="up" duration="800" easing="" elementOffset="10" name="Effect1" /> <mx:SeriesSlide direction="down" duration="800" easing="" elementOffset="10" name="Effect2" /> <mx:SeriesSlide direction="right" duration="800" easing="" elementOffset="10" name="Effect21" /> <mx:SeriesSlide direction="left" duration="800" easing="" elementOffset="10" name="Effect22" /> <mx:SeriesInterpolate duration="1200" offset="20" name="Interpolate" /> <mx <mx </mx:Effect> <mx:Panel id="mPanel0" styleName="panel" backgroundColor="#FFF9FF" height="100%" width="100%"> <mx:HBox styleName="layoutMargin" height="100%" width="100%"> <mx:BarChart id="barchart1" height="100%" width="100%" showDataTips="true"> <mx:verticalAxisRenderer> <mx:AxisRenderer styleName="axis" /> </mx:verticalAxisRenderer> <mx:horizontalAxisRenderer> <mx:AxisRenderer /> </mx:horizontalAxisRenderer> <mx:horizontalAxis> <mx:LinearAxis minimum="0.465" interval="0.001" maximum="0.467"/> </mx:horizontalAxis> <mx:verticalAxis> <mx:CategoryAxis categoryField="month"/> </mx:verticalAxis> <mx:series> <mx:Array> <mx:BarSeries xField="loans"/> </mx:Array> </mx:series> </mx:BarChart> <mx:Legend id="legend1"/> </mx:HBox> </mx:Panel> </mx:Application> |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sound Effects | jimmyhay | Other Flash General Questions | 2 | 12-16-2005 01:08 AM |
| questions about some effects | Marcel | Animation and Effects | 11 | 12-09-2004 03:53 PM |
| "PJ" and "Supreme 4" Components, flash text effects. | patrickjv | Components | 1 | 04-29-2004 07:31 PM |
| After Effects & Flash? | tenoch | Animation and Effects | 47 | 02-12-2004 10:43 AM |
| Effects | grimm | Animation and Effects | 4 | 08-13-2002 09:47 PM |