<?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; itemSelectionColor</title>
	<atom:link href="http://blog.flexexamples.com/tag/itemselectioncolor/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>Setting a ColumnChart control&#8217;s item roll over color and item selection color in Flex</title>
		<link>http://blog.flexexamples.com/2007/11/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/</link>
		<comments>http://blog.flexexamples.com/2007/11/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/#comments</comments>
		<pubDate>Sun, 25 Nov 2007 07:01:09 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[ColumnChart]]></category>
		<category><![CDATA[itemRollOverColor]]></category>
		<category><![CDATA[itemSelectionColor]]></category>
		<category><![CDATA[selectionMode]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/</guid>
		<description><![CDATA[<p>The following code shows you how you can customize the item roll over color and item selection color in a Flex ColumnChart control by setting the itemRollOverColor and itemSelectionColor styles.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColumnChart_itemSelectionColor_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0" encoding="utf-8"?&#62; &#60;!-- http://blog.flexexamples.com/2007/11/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/ --&#62; &#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white"&#62; &#60;mx:Script&#62; &#60;![CDATA[ import mx.charts.chartClasses.IAxis; [...]]]></description>
			<content:encoded><![CDATA[<p>The following code shows you how you can customize the item roll over color and item selection color in a Flex ColumnChart control by setting the <code>itemRollOverColor</code> and <code>itemSelectionColor</code> styles.</p>
<p>Full code after the jump.</p>
<p><span id="more-329"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/ColumnChart_itemSelectionColor_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/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/ --&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.charts.chartClasses.IAxis;

            private function linearAxis_labelFunc(item:Object, prevValue:Object, axis:IAxis):String {
                return numberFormatter.format(item);
            }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:NumberFormatter id="numberFormatter" precision="3" /&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:ColumnChart id="columnChart"
            showDataTips="true"
             dataProvider="{arrColl}"
             selectionMode="single"
             itemRollOverColor="haloSilver"
             itemSelectionColor="haloBlue"
             width="100%"
             height="100%"&gt;

        &lt;mx:horizontalAxis&gt;
            &lt;mx:CategoryAxis id="ca"
                    categoryField="name" /&gt;
        &lt;/mx:horizontalAxis&gt;

        &lt;mx:verticalAxis&gt;
            &lt;mx:LinearAxis baseAtZero="false"
                    minimum="0.200"
                    maximum="0.310"
                    labelFunction="linearAxis_labelFunc" /&gt;
        &lt;/mx:verticalAxis&gt;

        &lt;mx:horizontalAxisRenderers&gt;
            &lt;mx:AxisRenderer axis="{ca}"
                    canDropLabels="false" /&gt;
        &lt;/mx:horizontalAxisRenderers&gt;

        &lt;mx:series&gt;
            &lt;mx:ColumnSeries id="columnSeries"
                    xField="name"
                    yField="avg"
                    displayName="avg" /&gt;
        &lt;/mx:series&gt;

        &lt;mx:seriesFilters&gt;
            &lt;mx:Array /&gt;
        &lt;/mx:seriesFilters&gt;

    &lt;/mx:ColumnChart&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/ColumnChart_itemSelectionColor_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/ColumnChart_itemSelectionColor_test/bin/main.html" width="100%" height="500"></iframe></p>
<p>You can also set the itemSelectionColor and itemRollOverColor styles using CSS, as seen in the following snippet:</p>
<pre class="code">
&lt;mx:Style&gt;
    ColumnChart {
        itemRollOverColor: haloSilver;
        itemSelectionColor: haloBlue;
    }
&lt;/mx:Style&gt;
</pre>
<p>Or, you can set the styles using ActionScript, as seen in the following snippet:</p>
<pre class="code">
columnChart.setStyle("itemRollOverColor", "haloSilver");
columnChart.setStyle("itemSelectionColor", "haloBlue");
</pre>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Setting a ColumnChart control\&#039;s item roll over color and item selection color in Flex on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/',contentID: 'post-329',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'itemRollOverColor,itemSelectionColor,selectionMode',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/24/setting-a-columnchart-controls-item-roll-over-color-and-item-selection-color-in-flex/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

