<?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; callout</title>
	<atom:link href="http://blog.flexexamples.com/tag/callout/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>Customizing callout strokes in a Flex PieChart control</title>
		<link>http://blog.flexexamples.com/2007/11/10/customizing-callout-strokes-in-a-flex-piechart-control/</link>
		<comments>http://blog.flexexamples.com/2007/11/10/customizing-callout-strokes-in-a-flex-piechart-control/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 20:46:19 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[PieChart]]></category>
		<category><![CDATA[PieSeries]]></category>
		<category><![CDATA[callout]]></category>
		<category><![CDATA[calloutStroke]]></category>
		<category><![CDATA[caps]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/10/customizing-callout-strokes-in-a-flex-piechart-control/</guid>
		<description><![CDATA[<p>The following example shows how you can customize the callout stroke in a Flex PieChart control by using the PieSeries class&#8217;s calloutStroke style and the mx.graphics.Stroke class, as seen in the following snippet:</p> &#60;mx:PieChart dataProvider=&#34;{dp.product}&#34; height=&#34;250&#34; width=&#34;100%&#34;&#62; &#60;mx:series&#62; &#60;mx:PieSeries id=&#34;pieSeries&#34; field=&#34;@data&#34;&#62; &#60;mx:calloutStroke&#62; &#60;mx:Stroke color=&#34;black&#34;weight=&#34;2&#34; /&#62; &#60;/mx:calloutStroke&#62; &#60;mx:filters&#62; &#60;mx:Array /&#62; &#60;/mx:filters&#62; &#60;/mx:PieSeries&#62; &#60;/mx:series&#62; &#60;/mx:PieChart&#62; <p>To see [...]]]></description>
			<content:encoded><![CDATA[<p>The following example shows how you can customize the callout stroke in a Flex PieChart control by using the PieSeries class&#8217;s <code>calloutStroke</code> style and the mx.graphics.Stroke class, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:PieChart dataProvider=&quot;{dp.product}&quot; height=&quot;250&quot; width=&quot;100%&quot;&gt;
    &lt;mx:series&gt;
        &lt;mx:PieSeries id=&quot;pieSeries&quot; field=&quot;@data&quot;&gt;
            <span style="color:red;">&lt;mx:calloutStroke&gt;
                &lt;mx:Stroke color=&quot;black&quot;weight=&quot;2&quot; /&gt;
            &lt;/mx:calloutStroke&gt;</span>
            &lt;mx:filters&gt;
                &lt;mx:Array /&gt;
            &lt;/mx:filters&gt;
        &lt;/mx:PieSeries&gt;
    &lt;/mx:series&gt;
&lt;/mx:PieChart&gt;
</pre>
<p>To see an example of changing the stroke around the pie chart itself, see <a href="http://blog.flexexamples.com/2007/11/06/customizing-strokes-in-a-flex-piechart-control/">&#8220;Customizing strokes in a Flex PieChart control&#8221;</a>.</p>
<p>Full code after the jump.</p>
<p><span id="more-287"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/PieSeries_calloutStroke_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/10/customizing-callout-strokes-in-a-flex-piechart-control/ --&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.graphics.Stroke;

            private function setStroke(evt:Event):void {
                var stroke:Stroke = new Stroke();
                stroke.color = colorPicker.selectedColor;
                stroke.weight = slider.value;
                stroke.caps = comboBox.selectedItem.label;
                pieSeries.setStyle("calloutStroke", stroke);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="dp"&gt;
        &lt;products&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;/products&gt;
    &lt;/mx:XML&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:Form styleName="plain"&gt;
            &lt;mx:FormItem label="color:"&gt;
                &lt;mx:ColorPicker id="colorPicker"
                        change="setStroke(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="weight:"&gt;
                &lt;mx:HSlider id="slider"
                        minimum="0"
                        maximum="10"
                        value="0"
                        liveDragging="true"
                        snapInterval="1"
                        tickInterval="1"
                        change="setStroke(event);" /&gt;
            &lt;/mx:FormItem&gt;
            &lt;mx:FormItem label="caps:"&gt;
                &lt;mx:ComboBox id="comboBox"
                        change="setStroke(event);"&gt;
                    &lt;mx:dataProvider&gt;
                        &lt;mx:Array&gt;
                            &lt;mx:Object label="none" /&gt;
                            &lt;mx:Object label="round" /&gt;
                            &lt;mx:Object label="square" /&gt;
                        &lt;/mx:Array&gt;
                    &lt;/mx:dataProvider&gt;
                &lt;/mx:ComboBox&gt;
            &lt;/mx:FormItem&gt;
        &lt;/mx:Form&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:PieChart id="pieChart"
            dataProvider="{dp.product}"
            height="250"
            width="100%"&gt;
        &lt;mx:series&gt;
            &lt;mx:PieSeries id="pieSeries"
                    field="@data"
                    labelPosition="callout"&gt;
                &lt;mx:calloutStroke&gt;
                    &lt;mx:Stroke color="black"
                            weight="0"
                            caps="none" /&gt;
                &lt;/mx:calloutStroke&gt;
                &lt;mx:filters&gt;
                    &lt;mx:Array /&gt;
                &lt;/mx:filters&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/PieSeries_calloutStroke_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_calloutStroke_test/bin/main.html" width="100%" height="450"></iframe></p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Customizing callout strokes in a Flex PieChart control on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/10/customizing-callout-strokes-in-a-flex-piechart-control/',contentID: 'post-287',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'callout,calloutStroke,caps',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/10/customizing-callout-strokes-in-a-flex-piechart-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

