<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flex Examples &#187; SeriesInterpolate</title>
	<atom:link href="http://blog.flexexamples.com/category/seriesinterpolate/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.flexexamples.com</link>
	<description>Just a bunch of Adobe Flex Examples</description>
	<lastBuildDate>Wed, 26 Jan 2011 18:09:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Animating a Flex PieChart control&#8217;s rotation when a user clicks on an item</title>
		<link>http://blog.flexexamples.com/2007/11/22/animating-a-flex-piechart-controls-rotation-when-a-user-clicks-on-an-item/</link>
		<comments>http://blog.flexexamples.com/2007/11/22/animating-a-flex-piechart-controls-rotation-when-a-user-clicks-on-an-item/#comments</comments>
		<pubDate>Thu, 22 Nov 2007 08:12:46 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[PieChart]]></category>
		<category><![CDATA[SeriesInterpolate]]></category>
		<category><![CDATA[easingFunction]]></category>
		<category><![CDATA[perWedgeExplodeRadius]]></category>
		<category><![CDATA[startAngle]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/22/animating-a-flex-piechart-controls-rotation-when-a-user-clicks-on-an-item/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/11/07/rotating-a-flex-piechart-control-when-a-user-clicks-on-an-item/">&#8220;Rotating a Flex PieChart control when a user clicks on an item&#8221;</a>, we looked at changing a PieChart&#8217;s rotation when the user clicked on a pie wedge. In the following example, we look at how to add a nice animation effect with some easing to make the effect a bit [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/11/07/rotating-a-flex-piechart-control-when-a-user-clicks-on-an-item/">&#8220;Rotating a Flex PieChart control when a user clicks on an item&#8221;</a>, we looked at changing a PieChart&#8217;s rotation when the user clicked on a pie wedge. In the following example, we look at how to add a nice animation effect with some easing to make the effect a bit more smooth.</p>
<p>Full code after the jump.</p>
<p><span id="more-324"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PieSeries_showDataEffect_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/22/animating-a-flex-piechart-controls-rotation-when-a-user-clicks-on-an-item/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            import mx.effects.easing.*;
            import mx.charts.series.items.PieSeriesItem;
            import mx.charts.events.ChartItemEvent;

            private function pieChart_itemClick(evt:ChartItemEvent):void {
                var item:PieSeriesItem = evt.hitData.chartItem as PieSeriesItem;
                var degrees:Number = radiansToDegrees(item.startAngle);
                var arr:Array = [];
                if (checkBox.selected) {
                    arr[item.index] = 0.2;
                }
                pieSeries.perWedgeExplodeRadius = arr;
                pieSeries.startAngle -= degrees;

                dp.refresh();
            }

            private function radiansToDegrees(radians:Number):Number {
                return radians * (180 / Math.PI);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XMLListCollection id="dp"&gt;
        &lt;mx:source&gt;
            &lt;mx:XMLList&gt;
                &lt;product label="Product 1" data="3" /&gt;
                &lt;product label="Product 2" data="1" /&gt;
                &lt;product label="Product 3" data="4" /&gt;
                &lt;product label="Product 4" data="1" /&gt;
                &lt;product label="Product 5" data="5" /&gt;
                &lt;product label="Product 6" data="9" /&gt;
            &lt;/mx:XMLList&gt;
        &lt;/mx:source&gt;
    &lt;/mx:XMLListCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:CheckBox id="checkBox"
                label="Use perWedgeExplodeRadius:"
                labelPlacement="left"
                selected="true" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:PieChart id="pieChart"
            dataProvider="{dp}"
            showDataTips="true"
            itemClick="pieChart_itemClick(event);"
            height="100%"
            width="100%"&gt;
        &lt;mx:series&gt;
            &lt;mx:PieSeries id="pieSeries"
                    field="@data"
                    nameField="@label"&gt;
                &lt;mx:showDataEffect&gt;
                    &lt;mx:SeriesInterpolate duration="1500"
                            easingFunction="{Elastic.easeOut}" /&gt;
                &lt;/mx:showDataEffect&gt;
                &lt;mx:filters&gt;
                    &lt;mx:DropShadowFilter /&gt;
                &lt;/mx:filters&gt;
            &lt;/mx:PieSeries&gt;
        &lt;/mx:series&gt;
    &lt;/mx:PieChart&gt;

    &lt;mx:Legend dataProvider="{pieChart}" direction="horizontal" /&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PieSeries_showDataEffect_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PieSeries_showDataEffect_test/bin/main.html" width="100%" height="500"></iframe></p>
<p>But remember kids, just because you can add easing, doesn&#8217;t mean you always should! ;)</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Animating a Flex PieChart control\&#039;s rotation when a user clicks on an item on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/22/animating-a-flex-piechart-controls-rotation-when-a-user-clicks-on-an-item/',contentID: 'post-324',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'easingFunction,perWedgeExplodeRadius,startAngle',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/11/22/animating-a-flex-piechart-controls-rotation-when-a-user-clicks-on-an-item/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Using data effects to animate chart data</title>
		<link>http://blog.flexexamples.com/2007/10/15/using-data-effects-to-animate-chart-data/</link>
		<comments>http://blog.flexexamples.com/2007/10/15/using-data-effects-to-animate-chart-data/#comments</comments>
		<pubDate>Mon, 15 Oct 2007 14:19:51 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[BarChart]]></category>
		<category><![CDATA[Charting]]></category>
		<category><![CDATA[SeriesInterpolate]]></category>
		<category><![CDATA[SeriesSlide]]></category>
		<category><![CDATA[SeriesZoom]]></category>
		<category><![CDATA[showDataEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/10/15/236/</guid>
		<description><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/">&#8220;Animating data changes in a Flex Pie Chart&#8221;</a>, we looked at using the SeriesInterpolate effect to animate a pie chart when the data changed.</p> <p>The following example shows how you can use the SeriesInterpolate, SeriesSlide, and SeriesZoom effects to create different animations.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a [...]]]></description>
			<content:encoded><![CDATA[<p>In a previous example, <a href="http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/">&#8220;Animating data changes in a Flex Pie Chart&#8221;</a>, we looked at using the SeriesInterpolate effect to animate a pie chart when the data changed.</p>
<p>The following example shows how you can use the SeriesInterpolate, SeriesSlide, and SeriesZoom effects to create different animations.</p>
<p>Full code after the jump.</p>
<p><span id="more-236"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/BarChart_showDataEffect_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/10/15/using-data-effects-to-animate-chart-data/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private function updateDP():void {
                var str:String = categoryFieldComboBox.selectedItem.data;
                barSeries.xField = str;
                barSeries.displayName = str;
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:SeriesInterpolate id="seriesInterpolate" duration="1000" /&gt;
    &lt;mx:SeriesSlide id="seriesSlide" duration="1000" direction="right" /&gt;
    &lt;mx:SeriesZoom id="seriesZoom" duration="1000" /&gt;

    &lt;mx:Array id="dataEffects"&gt;
        &lt;mx:Object label="seriesInterpolate" data="{seriesInterpolate}" /&gt;
        &lt;mx:Object label="seriesSlide" data="{seriesSlide}" /&gt;
        &lt;mx:Object label="seriesZoom" data="{seriesZoom}" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:Array id="categoryFields"&gt;
        &lt;mx:Object data="obp" label="OBP" /&gt;
        &lt;mx:Object data="slg" label="SLG" /&gt;
        &lt;mx:Object data="avg" label="AVG" /&gt;
    &lt;/mx:Array&gt;

    &lt;mx:ArrayCollection id="arrColl"&gt;
        &lt;mx:source&gt;
            &lt;mx:Array&gt;
                &lt;mx:Object name="R Winn" obp=".353" slg=".445" avg=".300" /&gt;
                &lt;mx:Object name="P Feliz" obp=".290" slg=".418" avg=".253" /&gt;
                &lt;mx:Object name="O Vizquel" obp=".305" slg=".316" avg=".246" /&gt;
                &lt;mx:Object name="B Molina" obp=".298" slg=".433" avg=".276" /&gt;
                &lt;mx:Object name="R Durham" obp=".295" slg=".343" avg=".218" /&gt;
            &lt;/mx:Array&gt;
        &lt;/mx:source&gt;
    &lt;/mx:ArrayCollection&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form&gt;
            &lt;mx:FormItem label="categoryField:"&gt;
                &lt;mx:ComboBox id="categoryFieldComboBox"
                    dataProvider="{categoryFields}"
                        change="updateDP();" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="showDataEffect:"&gt;
                &lt;mx:ComboBox id="showDataEffectComboBox"
                        dataProvider="{dataEffects}"
                        change="updateDP();" /&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

     &lt;mx:BarChart id="barChart"
             showDataTips="true"
             dataProvider="{arrColl}"
             width="100%"
             height="100%"&gt;
        &lt;mx:verticalAxis&gt;
            &lt;mx:CategoryAxis categoryField="name"/&gt;
        &lt;/mx:verticalAxis&gt;
        &lt;mx:series&gt;
            &lt;mx:BarSeries id="barSeries"
                    yField="name"
                    xField="obp"
                    displayName="obp"
                    showDataEffect="{showDataEffectComboBox.selectedItem.data}" /&gt;
        &lt;/mx:series&gt;
    &lt;/mx:BarChart&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/BarChart_showDataEffect_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/BarChart_showDataEffect_test/bin/main.html" width="100%" height="400"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Using data effects to animate chart data on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/10/15/using-data-effects-to-animate-chart-data/',contentID: 'post-236',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'showDataEffect',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/10/15/using-data-effects-to-animate-chart-data/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Animating data changes in a Flex Pie Chart</title>
		<link>http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/</link>
		<comments>http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 02:13:22 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[PieChart]]></category>
		<category><![CDATA[PieSeries]]></category>
		<category><![CDATA[SeriesInterpolate]]></category>
		<category><![CDATA[showDataEffect]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/</guid>
		<description><![CDATA[<p>The following example shows how you can animate a pie chart using the showDataEffect effect and SeriesInterpolate class.</p> <p>Full code after the jump.</p> <p></p> <p>For more information on setting up charting in an Adobe Flex 3 Beta 1 project, see &#8220;<a href="http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/">Charting in Flex Builder 3 (public beta 1 edition)</a>&#8220;.</p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PieChart_showDataEffect_test/main.mxml">View MXML</a></p> &#60;?xml [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can animate a pie chart using the <code>showDataEffect</code> effect and SeriesInterpolate class.</p>
<p>Full code after the jump.</p>
<p><span id="more-204"></span></p>
<p>For more information on setting up charting in an Adobe Flex 3 Beta 1 project, see &#8220;<a href="http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/">Charting in Flex Builder 3 (public beta 1 edition)</a>&#8220;.</p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PieChart_showDataEffect_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"
        creationComplete="initDP();"&gt;

    &lt;mx:Script&gt;
        &lt;![CDATA[
            private const MAX_ITEMS:uint = 10;

            private function initDP():void {
                var i:uint;
                dp = [];
                for (i = 0; i &lt; MAX_ITEMS; i++) {
                    dp.push({data:getRandomUint(100), label:"item " + i});
                }
            }

            private function getRandomUint(max:uint):uint {
                return Math.round(Math.random() * max);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:Array id="dp" /&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Button label="Change Data"
                click="initDP();" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:PieChart id="chart"
            height="100%"
            width="100%"
            dataProvider="{dp}"&gt;
        &lt;mx:series&gt;
            &lt;mx:PieSeries field="data"&gt;
                &lt;mx:showDataEffect&gt;
                    &lt;mx:SeriesInterpolate duration="1000" /&gt;
                &lt;/mx:showDataEffect&gt;
            &lt;/mx:PieSeries&gt;
        &lt;/mx:series&gt;
    &lt;/mx:PieChart&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/PieChart_showDataEffect_test/bin/srcview/index.html">View source</a> is enabled in the following example.</p>
<p><iframe src="http://blog.flexexamples.com/wp-content/uploads/PieChart_showDataEffect_test/bin/main.html" width="100%" height="500"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Animating data changes in a Flex Pie Chart on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/',contentID: 'post-204',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'showDataEffect',providerName: 'FlexExamples.com',styling: 'text' });return false" class="evernoteSiteMemoryLink"><img src="http://static.evernote.com/article-clipper-remember.png" class="evernoteSiteMemoryButton" />
				</a>				<div class="evernoteSiteMemoryClear">&nbsp;</div>
</div>]]></content:encoded>
			<wfw:commentRss>http://blog.flexexamples.com/2007/09/24/animating-data-changes-in-a-flex-pie-chart/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

