Heatmap Tables with Excel
If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!
This Heatmap Table shows you the revenues and the discounts of a company over the course of one year per product group. The size of a bubble shows the revenue made in a particular month and the bubble color shows the discount rate given. The discount rate has been encoded as a range of green colors, ranging from a light green, for low discounts to a dark green for high discounts. The years and product totals are shown at the right and bottom as an integrated part of the table.
Tufte
The heatmap table is based on a regular Excel bubble chart. To integrate a bubble chart into a table the bubbles are positioned in a matrix that has the same row and column layout as our table.
![]()
In our case we generate a data series table with one column for the X-Series going from 1-12 for January -December and on column for our Y-Series going from 1-8 for our 8 product groups and one on column for revenue.
Now we create the bubble chart:
To ensure that the charts fit exactly into the table grid we set Min/Max for the X axis to 0.5/12.5 and for the Y axis to 0.5/8.5. Excel would calculate much larger auto scales otherwise. For the Grid lines we set the minor and major unit for both axis to 1.
Now we remove the legend, the X and Y axis, maximize the plot area and align the chart with the Excel table. As the bubbles are initially too large we have to make them smaller. To control the bubble size go to Data Series Options and scale the bubble size to 50%:
This already makes a nice bubble table you could use to reproduce the Twitter Charts.
For the grid lines format your table headers with light gray grid lines, enable the major grid lines in the chart and also format them with light gray. Set the chart area to transparent and reposition the chart so that the chart and the table grid lines align.
To create the heatmap we need a color ramp of 8 green colors, ranging from a light green to a dark green. You can re-define the Excel colors under Excel > Tools > Color, or simply coping the green color ramp of my sample file with Excel > Tools > Color >Copy Colors From
The trick with the colored bubbles is that by default Excel does not plot data points for #NA values. For the heatmap we overlay 8 bubble series, one series per green shade, and show a revenue bubble only if the value fits into the value range that corresponds with a green shade of our color ramp, otherwise we show #NA.
We divide the range 0…MAX(Discount) into 8 interval borders we put into the column headers: , 0, Step,2*Step,…..,MAX(Discount), where Step is MAX(Discount)/8
The data series columns use the following formula to test if a discount value corresponds with an interval / green shade:
=IF(AND(Discount>G$5-Step,Discount<=G$5),Revenue,NA())
The formula returns the revenue, if the discount values is in the interval defined in the column header G$5.
Create now the eight data series so that the bubble size refers to the eight columns in the data table:
Voila, a nice heat map table.
Now it would be nice to have some dynamic control over the size of your bubbles with a combo box in you sheet using an invisible scaling data series
You add a 9th data series:
The cell Data!C102 contains the formula = MAX(Revenue)*ScaleFactor, where scale factor is 2,3,5 for Small, Normal, Large. Having a larger bubble in the data set makes all other bubble smaller (by the factor ScaleFactor). To make this scale bubble invisible set the Border and Area to none.
To further enrich the graphical table we add two rows and columns for revenue and discounts totals :
Click here to download the Heatmap Table.
Posted August 24th, 2008 by Andreas under Charts, Excel Tricks.
Comments: 5
Comments
Comment from Daniel Peter
Time: August 25, 2008, 2:08 am
Great article and very helpful!
Comment from Jon Peltier
Time: August 25, 2008, 6:41 am
Andreas -
Very nice. The chart is reasonably done, and the instructions are clear and complete.
Comment from derek
Time: September 4, 2008, 3:37 pm
This heat map has bivariate data in the matrix, and also has a sensible order in one direction (months). But if your heat map data doesn’t need to be in any particular order, you can take a leaf out of Jacque Bertin’s book and diagonalize it for clearer pattern reading. I’ve described a method for doing it on my blog here.
Comment from Pankaj
Time: December 2, 2008, 1:56 am
Hi,
Could you help me understand:
How the heat map in airlines dashboard has been created using micro charts?
Thanks,
Pankaj
Comment from Andreas
Time: December 2, 2008, 7:48 am
Pankaj,
Yes the heat map in airlines dashboard was done using MicroCharts.
You find the steps to create heat maps with MicroCharts here:
http://www.websitetoolbox.com/tool/post/bonavista/vpost?id=2502256
Regards,
Andreas
Write a comment