<?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; datavisualization.swc</title>
	<atom:link href="http://blog.flexexamples.com/tag/datavisualization-swc/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>Charting in Flex Builder 3 (public beta 1 edition)</title>
		<link>http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/</link>
		<comments>http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/#comments</comments>
		<pubDate>Tue, 28 Aug 2007 07:44:43 +0000</pubDate>
		<dc:creator>Peter deHaan</dc:creator>
				<category><![CDATA[Charting]]></category>
		<category><![CDATA[charts.swc]]></category>
		<category><![CDATA[datavisualization.swc]]></category>

		<guid isPermaLink="false">http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/</guid>
		<description><![CDATA[<p>I&#8217;ve seen this come up on a few lists, and it is something I&#8217;ve struggled with, so I thought I&#8217;d do a brief post on it. Curious Flexers ask &#8220;How do I create charts in Flex 3?&#8221; (or &#8220;How do I use the AdvancedDataGrid in Flex 3?&#8221; also comes up).</p> <p>Well, the answer is you [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen this come up on a few lists, and it is something I&#8217;ve struggled with, so I thought I&#8217;d do a brief post on it. Curious Flexers ask &#8220;How do I create charts in Flex 3?&#8221; (or &#8220;How do I use the AdvancedDataGrid in Flex 3?&#8221; also comes up).</p>
<p>Well, the answer is you have to download the <a href="http://labs.adobe.com/technologies/flex/flexbuilder3/">public Flex Builder beta</a> from <a href="http://labs.adobe.com/">http://labs.adobe.com/</a> and manually add the appropriate SWC to the compiler arguments. In earlier versions of Flex Builder, the charting components were in a file named &#8220;charts.swc&#8221; (see &#8220;C:\Program Files\Adobe\Flex Builder 3\sdks\2.0.1\frameworks\libs\&#8221;, for example) but in Flex Builder 3 the file is now named &#8220;datavisualization.swc&#8221; and it lives in &#8220;C:\Program Files\Adobe\Flex Builder 3\sdks\moxie\frameworks\libs\&#8221; (as of the Adobe Labs public beta 1, this path may change in future releases).</p>
<p>Anyways, long story short, the easiest way I&#8217;ve found to create a Flex 3 application that uses charts is to create a new Flex 3 project, set the compiler to &#8220;Flex Moxie M2&#8243; (the default that came with the Adobe Labs Flex Builder public beta 1 &#8212; it seems my newer nightly build has some conflicts), and then add the &#8220;datavisualization.swc&#8221; into the Flex project&#8217;s library path. How do you do that, you may be asking yourself? Well, right-click on your project in Flex Builder and select &#8220;Properties&#8221; from the context menu. Next, select the &#8220;Flex Build Path&#8221; item from the list on the left, then click on the &#8220;Library path&#8221; tab. Click the &#8220;Add SWC&#8221; button, and navigate to &#8220;C:/Program Files/Adobe/Flex Builder 3/sdks/moxie/frameworks/libs/datavisualization.swc&#8221; and click &#8220;Open&#8221;, then &#8220;OK&#8221;. Click OK again to dismiss the project properties dialog box and return to the Flex Builder workspace. Now, you should be fine to create a charting or AdvancedDataGrid component application. Whew!</p>
<p>And just to prove that this little &#8220;Flexperiment&#8221; works, the following example creates a simple HLOC chart (High Low Open Close) which plots the historical Adobe stock price for the month of August 2007.</p>
<p>Full code after the jump.</p>
<p><span id="more-140"></span></p>
<p class="download"><a href="http://blog.flexexamples.com/wp-content/uploads/Charts_test/main.mxml">View MXML</a></p>
<pre class="code">
&lt;?xml version="1.0"?&gt;
&lt;!-- http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/ --&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[
            [Bindable]
            [Embed(source='assets/money.png')]
            private var MoneyIcon:Class;
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:XML id="quotesXML" source="adbe.xml" format="e4x" /&gt;
    &lt;mx:XMLListCollection id="adbe" source="{quotesXML.quote}" /&gt;

    &lt;mx:String id="ADBE_YAHOO"&gt;http://finance.yahoo.com/q?d=t&amp;amp;s=ADBE&lt;/mx:String&gt;

    &lt;mx:ApplicationControlBar dock="true"&gt;
        &lt;mx:LinkButton icon="{MoneyIcon}"
                label="ADBE"
                click="navigateToURL(new URLRequest(ADBE_YAHOO))"
                fontSize="14"
                fontWeight="bold" /&gt;
    &lt;/mx:ApplicationControlBar&gt;

    &lt;mx:VBox backgroundColor="white" width="100%" height="100%"&gt;
        &lt;mx:HLOCChart id="hlocChart"
                showDataTips="true"
                dataProvider="{adbe}"
                width="100%"
                height="100%"&gt;

            &lt;!-- vertical axis --&gt;
            &lt;mx:verticalAxis&gt;
                &lt;mx:LinearAxis baseAtZero="false" /&gt;
            &lt;/mx:verticalAxis&gt;

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

            &lt;!-- series --&gt;
            &lt;mx:series&gt;
                &lt;mx:HLOCSeries id="series1"
                        highField="@high"
                        lowField="@low"
                        openField="@open"
                        closeField="@close"/&gt;
            &lt;/mx:series&gt;
        &lt;/mx:HLOCChart&gt;
    &lt;/mx:VBox&gt;

&lt;/mx:Application&gt;
</pre>
<p class="information"><a href="http://blog.flexexamples.com/wp-content/uploads/Charts_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/Charts_test/bin/main.html" width="100%" height="400"></iframe></p>
<p class="alert">Note that the &#8220;datavisualization.swc&#8221; file is currently only available in the Adobe Flex Builder 3 public beta, and not in the nightly SDK builds. For more information, see the <a href="http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=72&#038;catid=651&#038;threadid=1293407&#038;highlight_key=y&#038;keyword1=datavisualization%2Eswc">&#8220;Latest datavisualization.swc?&#8221;</a> thread in the <a href="http://www.adobe.com/cfusion/webforums/forum/categories.cfm?catid=651&#038;flcache=478804">Adobe Flex Builder 3 Labs Forums</a>.</p>
<div class="evernoteSiteMemory"><a href="javascript:" onclick="Evernote.doClip({title: 'Charting in Flex Builder 3 (public beta 1 edition) on FlexExamples.com',url: 'http://blog.flexexamples.com/2007/08/27/charting-in-flex-builder-3-public-beta-1-edition/',contentID: 'post-140',code: 'Pete9667',suggestNotebook: 'FlexExamples',suggestTags: 'charts.swc,datavisualization.swc',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/08/27/charting-in-flex-builder-3-public-beta-1-edition/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
	</channel>
</rss>

