Launch, grow, and unlock your career in data

September 1, 2010

Tableau Tip: Shading an Area

No comments
In an August issue of Time Magazine (I can't recall exactly which) there was a discussion contrasting economic indicators that show we're in a Bear market against other indicators which show we're in a Bull market.

The first, which supports the notion that we're in a Bear market, looks like the following:

The second, which supports the notion that we're in a Bull market, looks like the following:

The image that I found most interesting and wanted to duplicate in Tableau is the Manufacturing trend show in the middle of the Bull market graphic. Here it is enlarged:

A couple of things I noticed:
  • The vertical axis does not start at zero, which can mislead the reader into thinking growth is greater than it really is.
  • The time frame is quite short. I understand that the purpose of the chart is to indicate recent growth, but it prohibits the reader from making any comparisons to the past.
  • The shaded areas draw the reader's eyes to the times of growth. This is a very good used of shading and provided me the challenge to reproduce the shading of just these areas in Tableau.

Here's how I did it.

First, I created the line chart you see below (I won't go into each of the individual steps).

The important part of this step is to add a Reference Band with the following settings, which provides the shading of everything between the axis (50% and above indicate growth) and the line.

The key settings are:
  1. It must be a Band.
  2. The band must be from a constant to the ISM index value so that only the areas between the line and 50% are shaded.

The trick to shading only the growth areas is to add a Reference Line with the following properties:

The key settings are:
  1. It must be a Line.
  2. The line must be based on the constant 50. Again, this is the trigger point for a bear or bull market.
  3. The fill below the line must be white (or whatever color you have set as your background).

And viola, only the growth areas are shaded.

Of the issues I saw, here's what I fixed:
  • The vertical axis now starts at zero.
  • The time frame extends back 10 years. Notice that in this extended time frame, it's quite evident that there was a LONG growth period from July 2003 through November 2007. We've been in a recession since.

If you would like to play with the workbook yourself, you can download it here. There are many more measures/indicators to use in your analysis. Let me know what else you find; post your analysis as a comment.

No comments

Post a Comment