Flex 3 Charting Woes

• Wednesday May 21st by Bucky in Flex 3 Development

Last weekend I set out to add some nice little charting touches to the last.fm Flex 3 application I’m working on only to discover it’s not as easy as the livedocs on charting make it out to be. I looked over a few examples on the docs and thought I had a decent grasp on it, so I set out to create my own pie chart, cause, well, pies are delicious.

I started by trying to write the following code:

<mx:PieChart id="topArtistsPieChart"
                   dataProvider="{topCollection}"
                   showDataTips="true"
                   dataTipFunction="createDataTips">

I say trying, because as soon as I wrote

<mx:Pi

I expected Code Assist to jump in and save the day and show me PieChart. Much to my chagrin it didn’t. Being the developer I am, conditioned to trust everything about Code Assist, I immediately stopped coding and thought to myself double yew tee eff!! and started searching for a reason that it wasn’t doing work for me.

I spent the better part of a Saturday morning looking through the LiveDocs and doing google searches, all to no avail. It wasn’t until out of desperation that I emailed the Adogo mailing list and finally got an answer from Brian LeGros aka Yoda. He found this posting from FlexExamples.com explaining what the problem was. If you didn’t click, the problem is that you have to include the datavisualization swc in your project before you can use charting.

This just confused me. First, I’ve never had to include any swcs from any Adobe libraries before, why would I have to now? Second, and more importantly, if I suddenly have to include swcs from Adobe, why the hell didn’t they make that clear in their livedocs? I didn’t see one place in the docs, including the language reference, that mentioned having to include this swc to get the charting functionality. I saw plenty of sentences pimping the professional version by telling me I have to buy it if I don’t want a watermark, but not a single one saying, “FIND THE SWC HERE, STUPID!”

Regardless, as the FlexExamples post says, on Windows, find the swc here: “C:\Program Files\Adobe\Flex Builder 3\sdks\moxie\frameworks\libs\. On OS X, find it at Applications/Adobe Flex Builder 3/sdks/3.0.0/frameworks/libs/. On Linux, ha, Adobe hates you, Linux, good luck.

Tags:

3 Comments

  1. This is a great tip for the Flex community. Charting gives Flex a lot of potential to become more mainstream as an RIA technology. There are some pretty cool JS api’s out there that can provide similar tools, but data binding just makes things so much easier.

    Blog looks good man, looking forward to seeing your app at the next Adogo!

    Comment by Brian LeGros on May 31, 2008 at 8:55 am

  2. This post confirmed that I was, indeed, not losing my mind. Thank you so much — twas’ a huge help!

    Comment by Tyler Parker on March 30, 2009 at 4:08 pm

  3. I’m glad this helped you out, Tyler.

    Comment by Bucky on April 7, 2009 at 11:32 pm

Leave a comment

RSS feed for comments on this post. TrackBack URL


© david 'bucky' schwarz 2006 - 2010 | Contact