Animated Stacked Chart

| 4 Comments | 0 TrackBacks

Today I had a couple of hours to kill and stumbled upon an interesting flash chart at flowingdata.com.

It's an animated chart that allows you to explore Average Consumer Spending in the USA by category from 1984 through 2008. I thought it would be interesting to emulate the animation in Excel and here's what I came up with:

AverageConsumerSpending.png
Now mind you, I'm not sure I like the value axis changing scale on a chart, but to emulate this properly that was a requirement. It actually turned out pretty well. If you click on any of the categories, the whole chart morphs... it's pretty cool. Clicking again brings it back to normal. There's a check box at the top to turn off the animation, and I suggest you do so if you plan to edit the chart.

This is most definitely a VBA project, but interestingly most of the work is done by worksheet formulas and the VBA glues it together and animates it. One thing I learned crafting this was that adding a shadow to the Chart Area dramatically crippled the speed at which the animation takes place - so I removed the shadow!

The project uses a modified version of Jon Peltier's chart event class. You can re-color the chart categories by changing a couple of RGB values in the SetColor sub-procedure. The code there does a straight linear interpolation in RGB color space between the two provided colors for the 14 spending categories.

I think it would be time well spent to investigate how this chart works.

Here's the workbook:

If you liked this article, please share it!



Your Ad Here

No TrackBacks

TrackBack URL: http://www.excelhero.com/cgi-bin/mt/mt-tb.cgi/25

4 Comments

Wow, you have done it again. Very cool. I agree with your comments on changing the axis, but it is certainly a very cool proof of concept. I am going to tear into and see if I can grasp how you did it [not likely, but maybe if I drink enough coffee]. Keep up the great work!!!!

Very cool indeed. When I look at highly usable and intuitive charts like these, I often wonder when Excel would make all this "automatically". As more and more people (and decision makers) get used to iPhone style visualizations and presentations, excel charts might need a huge boost in the way they work to ensure productivity.

thank you so much for the source file. I am going to spend a weekend with it to learn few tricks.

You are welcome, Chandoo!

I like it too. I keep finding myself tinkering with it between other tasks...

Regards,

Daniel

"adding a shadow dramatically crippled the speed at which the animation takes place"

Yet another reason not to add such fluff.

The effect itself is interesting, but does not help at all in conveying the information. Perhaps seeing the individual series after the scale has finished changing would be worthwhile, but the intermediate "growth" of the area is only a cool parlor trick.

Of course it never hurts to work through the mechanics of such a problem, because there may be useful applications of this animation elsewhere.

Leave a comment

About this Entry

This page contains a single entry by Daniel Ferry published on March 25, 2010 8:09 PM.

Excel, a Presentation Platform? was the previous entry in this blog.

Excel Optical Illusions #6 is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.