Build a Highlight Table or Heat Map
Use highlight tables to compare categorical data using color.
In Tableau, you create a highlight table by placing one or more dimensions on the Columns shelf and one or more dimensions on the Rows shelf. You then select Square as the mark type and place a measure of interest on the Color shelf.
You can enhance this basic highlight table by setting the size and shape of the table cells to create a heat map.
To create a highlight table to explore how profit varies across regions, product sub-categories, and customer segments, follow these steps:
-
Connect to the Sample - Superstore data source.
-
Drag the Segment dimension to Columns.
Tableau creates headers with labels derived from the dimension member names.
-
Drag the Region and Sub-Category dimensions to Rows, dropping Sub-Category to the right of Region.
Now you have a nested table of categorical data (that is, the Sub-Category dimension is nested within the Region dimension).
-
Drag the Profit measure to Color on the Marks card.
Tableau aggregates the measure as a sum. The color legend reflects the continuous data range.
In this view, you can see data for only the Central region. Scroll down to see data for other regions.
In the Central region, copiers are shown to be the most profitable sub-category, and binders and appliances the least profitable.
-
Click Color on the Marks card to display configuration options. In the Border drop-down list, select a medium gray color for cell borders, as in the following image:
Now it's easier to see the individual cells in the view:
-
The default color palette is Orange-Blue Diverging. A Red-Green Diverging palette might be more appropriate for profit. To change the color palette and to make the colors more distinct, do the following:
-
Hover over the SUM(Profit) color legend, then click the drop-down arrow that appears and select Edit Colors.
-
-
In the Edit Colors dialog box, in the Palette field, select Red-Green Diverging from the drop-down list.
-
Select the Use Full Color Range check box and click Apply and then click OK.
When you select this option, Tableau assigns the starting number a full intensity and the ending number a full intensity. If the range is from -10 to 100, the color representing negative numbers changes in shade much more quickly than the color representing positive numbers.
When you do not select Use Full Color Range, Tableau assigns the color intensity as if the range was from -100 to 100, so that the change in shade is the same on both sides of zero. The effect is to make the color contrasts in your view much more distinct.
For more information about color options, see Color Palettes and Effects.
Modify the size to create a heat map
-
Drag the Sales measure to Size on the Marks card to control the size of the boxes by the Sales measure. You can compare absolute sales numbers (by size of the boxes) and profit (by color).
Initially, the marks look like this:
-
To enlarge the marks, click Size on the Marks card to display a size slider:
-
Drag the slider to the right until the boxes in the view are the optimal size. Now your view is complete:
Check your work! Watch steps 1-9 below: