Stacked area chart is visually attractive in displaying multiple members' values evolving along another dimension, such as time series.
There may be various ways of coloring the stacked area chart. But I found that using gradient shades of the same color makes the chart highly attractive.
On the other hand, stacked area chart is vertically challenged because we can't compare easily along the vertical dimension. The contrast is not as sharp as in bar chart. We will add a bar chart in tooltips to boost the vertical comparison.
The example here is based on a viz by Andy Cotgreave and a recent Viz of the Day, results of the #MakeoverMonday.
1. Coloring the chart
The main steps include:
- Using gradient (discrete) shades of the same color
- Darker to lighter from bottom to top
- Highlighting one member using a different color if needed
Please refer to this article on highlighting one member among others in gradient shades of the same color. The highlighting can be made dynamic via a parameter.

2. Tooltip design
In the bar chart in tooltips, I would like to highlight the data mark I am hovering opon in a different color. I thus need 3 sets of new fields/variables. For a given dimension member, only one of the blue bar and the orange bar is lighted up at anytime.
The creation of the following variables can be made easier by a technique here. The bar chart in tooltips is described here.
- Blue bars for the data marks when they are not hovered upon. Note that a window function has to be used to get the values of non-hovered data marks.
- Orange bars for the data marks when they are hovered upon.
- Labels for the orange bars. Only one label will show at anytime.
The code for the tooltips are as follows:The resulting tooltip is as follows:

That's how we can make a boosted stacked area chart. This technique can apply to stacked bar chart or any chart where you want to enhance the contrast in some dimension.
The workbook can be accessed here to view the tooltips in action.
View comments