Chart uses the standard Flex effect like Zoom and Fade.
Chart uses the standard Flex effect like Zoom and Fade.Chart uses the standard Flex effect like Zoom and Fade. There are some standard effect for chart series which is: SeriesInterpolate, SeriesSlide, SeriesZoom. These classes uses the mx.charts.effects.effects package. The base class for chart effect is SeriesEffect. You can triggered the effect on focusInEffect, focusOutEffect, moveEffect, showEffect, and hideEffect. In this example we use a two dropdownlist: Category field and Choose Chart effect. First you will select form Category field and after that Chart effect and you will see the effect of series.
|
<?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"minWidth=" 955" minHeight="600" initialize="init()">duration=" 1000"minimumElementDuration=" 50"elementOffset=" 50"verticalFocus=" top"horizontalFocus=" left"relativeTo=" chart"/> </fx:Declarations><![CDATA[ import mx.collections.ArrayCollection;[ Bindable] public var student:ArrayCollection = new ArrayCollection([{Stream: "Management", Girls:1000, Boys:1400, TotalStudent:2400},{Stream: "Computer Science", Girls:800, Boys:1200, TotalStudent:2000},{Stream: "Mechanical", Girls:200, Boys:1500, TotalStudent:1700},{Stream: "Electical", Girls:800, Boys:850, TotalStudent:1650},{Stream: "Electronics", Girls:500, Boys:1000, TotalStudent:1500},{Stream: "Civil", Girls:300, Boys:900, TotalStudent:1200}]); cs1.yField = str; cs1.displayName = str; cs1.setStyle( "fill" , "738994");} else if(str == "Boys"){cs1.yField = str; cs1.displayName = str; cs1.setStyle( "fill" , "999990");} else{cs1.yField = str; cs1.displayName = str; cs1.setStyle( "fill" , "406374");} } private function init():void{catfDP.selectedIndex= 0; effectDP.selectedIndex= 0; } ]]> height="19"> <s:dataProvider> <mx:ArrayList>dataProvider=" {student}"showDataTips=" true"width=" 621"fontFamily=" verdana" height="402"> <mx:verticalAxis> <mx:LinearAxis title="Number of Students" />categoryField=" Stream"title=" Stream"/> </mx:horizontalAxis>xField=" Stream"yField=" Girls"displayName=" Girls"fill=" {s1}"showDataEffect=" {effectDP.selectedItem.data}"/> </mx:series> </mx:ColumnChart>direction=" horizontal"/></s:Application> |
To view this page ensure that Adobe Flash Player version 10.0.0 or greater is installed.