Use SeriesSlide effect to make the data slide in and out : Slide Effect « Effects « Flex






Use SeriesSlide effect to make the data slide in and out

Use SeriesSlide effect to make the data slide in and out
   
<!--
Code from Flex 4 Documentation "Using Adobe Flex 4".

This user guide is licensed for use under the terms of the Creative Commons Attribution 
Non-Commercial 3.0 License. 

This License allows users to copy, distribute, and transmit the user guide for noncommercial 
purposes only so long as 
  (1) proper attribution to Adobe is given as the owner of the user guide; and 
  (2) any reuse or distribution of the user guide contains a notice that use of the user guide is governed by these terms. 
The best way to provide notice is to include the following link. 
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/

-->
<!-- charts/BasicSeriesSlideEffect.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
    <mx:Script>
        import mx.collections.ArrayCollection;
        [Bindable]
        public var expenses1:ArrayCollection = new ArrayCollection([
            {Month:"Jan", Income:2000, Expenses:1500},
            {Month:"Feb", Income:1000, Expenses:200},
            {Month:"Mar", Income:1500, Expenses:500}
            ]);
        [Bindable]
        public var expenses2:ArrayCollection = new ArrayCollection([
            {Month:"Jan", Income:1200, Expenses:800},
            {Month:"Feb", Income:2500, Expenses:300},
            {Month:"Mar", Income:575, Expenses:490}
            ]);
        public function changeProvider():void {
            myChart.dataProvider=expenses2;
        }
      </mx:Script>
    <!-- Define chart effects -->
    <mx:SeriesSlide id="slideIn" duration="1000" direction="up" />
    <mx:SeriesSlide id="slideOut" duration="1000" direction="down" />
    <mx:Panel title="Column Chart with Basic Series Slide Effect">
        <mx:ColumnChart id="myChart" dataProvider="{expenses1}">
            <mx:horizontalAxis>
                <mx:CategoryAxis dataProvider="{expenses1}"
                    categoryField="Month" />
            </mx:horizontalAxis>
            <mx:verticalAxis>
                <mx:LinearAxis minimum="0" maximum="3000" />
            </mx:verticalAxis>
            <mx:series>
                <mx:ColumnSeries xField="Month" yField="Income"
                    displayName="Income" showDataEffect="slideIn"
                    hideDataEffect="slideOut" />
                <mx:ColumnSeries xField="Month" yField="Expenses"
                    displayName="Expenses" showDataEffect="slideIn"
                    hideDataEffect="slideOut" />
            </mx:series>
        </mx:ColumnChart>
        <mx:Legend dataProvider="{myChart}" />
    </mx:Panel>
    <mx:Button id="b1" click="changeProvider()" label="Change Data Provider" />
</mx:Application>

   
    
    
  








Related examples in the same category

1.slideDown effectslideDown effect
2.Define slideIn effect that plays every time the user adds a dataDefine slideIn effect that plays every time the user adds a data
3.seriesIn and seriesOut effects to slide the columns in and outseriesIn and seriesOut effects to slide the columns in and out