Jorge Camoes wrote in Focus + Context (a Bar Chart Is Not a Skyscraper) that tall bar charts are a waste of space. If you plan to show everything (say, all fifty state names), you may as well just use a table. I’m not sure I completely agree, but part of his point is that you shouldn’t overwhelm a reader with too much data all at once, because it will obscure the information.
Jorge used a data set Nathan provided for his Poverty in the US visualization project. The chart Jorge dislikes looks like this:
It’s not really terrible, though I won’t deny it’s dull and maybe a bit cluttered. It’s more informative if less glossy than the infographic that was favored in Nathan’s challenge. But Jorge thinks that showing all of the state names was too much.
In some cases, an effective display might be to show two charts, the top five and the bottom five, and ignore the data in between.
But Jorge also wanted something interactive. So I put together a little dynamic chart that had all fifty bars but highlights the five closest to the current mouse location. As you move the mouse up and down along the chart, the highlighted region moves with the mouse.
Pretty cool, and the actual chart (see below for a download) is cooler than the static image above.
Well, Jorge is a pretty tough customer. He doesn’t just want to highlight the bars under the mouse. He wants to expand them, and shrink the unhighlighted bars. The effect is rather like an accordion. It was all I could do to keep up with Jorge’s requirements, but I cobbled together an example that I think he’ll be happy with.
Not only are a handful of bars under the mouse highlighed, but the highlighted bars are big and fat, while the unhighlighted bars are small and unobtrusive. And it’s completely interactive.
Again, the dynamic chart in the sample download is way cooler than this screen shot. An advantage of the accordion chart is that the unhighlighted bars can be compressed, shrinking the chart without shrinking the highlighted region. This ability to fit the same dynamic information into a smaller space would make this a good candidate approach for an interactive dashboard.
You can download Accordion.zip, which contains two Excel 2003 worbooks. NoAccordion1.xls is the plain version, with highlighting but no accordion-like expansion and contraction. Accordion1.xls is the deluxe version, where the highlighted region expands to grab your attention, while the unhighlighted bars shrink into the background. Open each workbook with macros enabled, then click on the chart to activate the animation.
The data is on the second worksheet of each workbook, along with a set of helper columns with the calculations that make the charts work. The code is unlocked, and you’ll be surprised how simple it is. Hardly a dozen lines in each workbook.
Update – 12 February 2009
Colin has noted that the accordion chart above would be better if all bars were labeled. I’ve adjusted the Accordion chart so the unhighlighted bars have lighter labels.
I’ve added labels for unhighlighted bars in the NoAccordion chart. In response to Colin’s other suggestions, I’ve also changed the mouse actions so that mousing past the bars doesn’t move the highlighted region, but instead clicking on a bar or label toggles that bar between highlighted and unhighlighted status. In this chart I’ve highlighted the New England states.
These workbooks are Accordion2.xls and NoAccordion2.xls, found in Accordion2.zip.
Update 2 – 12 February 2009
Dick Kusleika has made an adaptation to this chart that always displays the user’s home state. As he so astutely points out, “Does anyone really look at the top or bottom five before he finds his own state?” Read about it in Ego Charts.