<?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; baseAtZero</title>
	<atom:link href="http://blog.flexexamples.com/tag/baseatzero/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>Controlling whether a LineChart should set its base value at zero</title>
		<link>http://blog.flexexamples.com/2007/11/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/</link>
		<comments>http://blog.flexexamples.com/2007/11/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 06:24:04 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[LinearAxis]]></category>
		<category><![CDATA[LineSeries]]></category>
		<category><![CDATA[baseAtZero]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/11/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/</guid>
		<description><![CDATA[<p>The following example creates a simple LineChart in Flex 3 and lets you toggle the baseAtZero property which controls whether the minimum or maximum chart value should be set to zero. Since a sample is worth 1000 words, read on.</p> <p>Full code after the jump.</p> <p></p> <p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinearAxis_baseAtZero_test/main.mxml">View MXML</a></p> &#60;?xml version="1.0"?&#62; &#60;!-- http://blog.flexexamples.com/2007/11/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/ --&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The following example creates a simple LineChart in Flex 3 and lets you toggle the <code>baseAtZero</code> property which controls whether the minimum or maximum chart value should be set to zero. Since a sample is worth 1000 words, read on.</p>
<p>Full code after the jump.</p>
<p><span id="more-292"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/LinearAxis_baseAtZero_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/11/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/ --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        layout="vertical"
        verticalAlign="middle"
        backgroundColor="white"&gt;

    &lt;mx:XMLListCollection id="dp"&gt;
        &lt;mx:source&gt;
            &lt;mx:XMLList&gt;
                &lt;quote date="8/27/2007" open="40.38" high="41.11" low="40.25" close="40.81" /&gt;
                &lt;quote date="8/24/2007" open="40.5" high="40.65" low="39.8" close="40.41" /&gt;
                &lt;quote date="8/23/2007" open="40.82" high="40.99" low="40.33" close="40.6" /&gt;
                &lt;quote date="8/22/2007" open="40.4" high="41" low="40.2" close="40.77" /&gt;
                &lt;quote date="8/21/2007" open="40.41" high="40.95" low="39.87" close="40.13" /&gt;
                &lt;quote date="8/20/2007" open="40.55" high="40.85" low="39.94" close="40.74" /&gt;
                &lt;quote date="8/17/2007" open="40.18" high="40.48" low="39.32" close="40.32" /&gt;
                &lt;quote date="8/16/2007" open="39.83" high="40.56" low="39.28" close="39.96" /&gt;
                &lt;quote date="8/15/2007" open="40.22" high="41.25" low="40.12" close="40.18" /&gt;
                &lt;quote date="8/14/2007" open="41.01" high="41.05" low="40.18" close="40.41" /&gt;
                &lt;quote date="8/13/2007" open="41" high="41.13" low="40.26" close="40.83" /&gt;
                &lt;quote date="8/10/2007" open="41.3" high="41.62" low="40.1" close="41.06" /&gt;
                &lt;quote date="8/9/2007" open="39.9" high="41.74" low="39.86" close="40.75" /&gt;
                &lt;quote date="8/8/2007" open="39.61" high="40.67" low="39.5" close="40.23" /&gt;
                &lt;quote date="8/7/2007" open="39.08" high="39.91" low="38.61" close="39.42" /&gt;
                &lt;quote date="8/6/2007" open="38.71" high="39.77" low="38.54" close="39.38" /&gt;
                &lt;quote date="8/3/2007" open="39.47" high="39.66" low="38.7" close="38.75" /&gt;
                &lt;quote date="8/2/2007" open="39.4" high="39.8" low="39.05" close="39.52" /&gt;
                &lt;quote date="8/1/2007" open="40.29" high="40.49" low="38.57" close="39.58" /&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="baseAtZero:"
                labelPlacement="left"
                selected="false" /&gt;

        &lt;mx:Spacer width="100%" /&gt;

        &lt;mx:Legend dataProvider="{lineChart}" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:LineChart id="lineChart"
            showDataTips="true"
            dataProvider="{dp}"
            width="100%"
            height="100%"&gt;

        &lt;!-- series filters --&gt;
        &lt;mx:seriesFilters&gt;
            &lt;mx:Array /&gt;
        &lt;/mx:seriesFilters&gt;

        &lt;!-- vertical axis --&gt;
        &lt;mx:verticalAxis&gt;
            &lt;mx:LinearAxis baseAtZero="{checkBox.selected}" title="Price" /&gt;
        &lt;/mx:verticalAxis&gt;

        &lt;!-- horizontal axis --&gt;
        &lt;mx:horizontalAxis&gt;
            &lt;mx:CategoryAxis id="ca" categoryField="@date" title="Date" /&gt;
        &lt;/mx:horizontalAxis&gt;

        &lt;!-- horizontal axis renderer --&gt;
        &lt;mx:horizontalAxisRenderers&gt;
            &lt;mx:AxisRenderer axis="{ca}" canDropLabels="true" /&gt;
        &lt;/mx:horizontalAxisRenderers&gt;

        &lt;!-- series --&gt;
        &lt;mx:series&gt;
            &lt;mx:LineSeries yField="@close" form="curve" displayName="Close" /&gt;
            &lt;mx:LineSeries yField="@open" form="curve" displayName="Open" /&gt;
        &lt;/mx:series&gt;

    &lt;/mx:LineChart&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/LinearAxis_baseAtZero_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/LinearAxis_baseAtZero_test/bin/main.html" width="100%" height="500"></iframe></p>
<p>For more information on the NumericAxis class&#8217;s <code>baseAtZero</code> property, see <a href="http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/NumericAxis.html#baseAtZero">http://livedocs.adobe.com/flex/3/langref/mx/charts/chartClasses/NumericAxis.html#baseAtZero</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Controlling whether a LineChart should set its base value at zero on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/11/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/',contentID: 'post-292',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'baseAtZero',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/12/controlling-whether-a-linechart-should-set-its-base-value-at-zero/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

