A heat map is a two-dimensional representation of data in which values are represented by colors. A simple heat map provides an immediate visual summary of information. More elaborate heat maps allow the viewer to understand complex data sets. There can be many ways to display heat maps, but they all share one thing in common – they use color to communicate relationships between data values that would be would be much harder to understand if presented numerically in a spreadsheet.
Custom sorting for the Heat Map columns
When you are displaying data across two categories in the form of a heat map matrix, there will be times where you want to display the data by “hour of day” and “day of week”, or “hour of day” with “day of month”, for example. In these cases, you generally want your time heat map axis to be sorted by day or time. However, you may find that your axis showing “day of week” is not ordered properly.
To sort the days of the week, you will need to create an intermediate step that allows you to sort in your desired order. This involves adding a case statement to apply a number to each day of the week and then sorting on the number assigned.
To accomplish your desired sorting, you can use a Case Statement step in the data pipeline as shown below, creating a new column called “day of week number”:
Next, you will add a Sort Rows step to sort your column by our newly created “day of week number” column.
Lastly, you can use a Hide Columns step to hide the “day of week number’ column as it’s not needed once the sort has been completed.
Reviewing your heat map should now show that your results are sorted in your desired order. This trick not only works great for Heat Maps but also in other instances where you find you would like to apply a custom sort order.
Note: You may need to go into the Chart Settings and select “Unsorted” on the y-axis for your custom sort preference to be applied. For certain charts like the heat map, you can apply additional sorting from the chart setting and they are defaulted to ascending.
Custom Heat Map Colors
For additional customization of your Heat Map, you can define the ends of the color spectrum for your map using the Chart Settings and navigating to the Color and then toggling the “Use custom colors” option. You will be provided selections for the Start and End colors for your heat map. Choose colors with greater contrast to make reading your heat map easier.
If you would like to increase the contrast between your color choices, you can toggle the “Enhance contrast” option on the General setting tab in the Chart Settings.
If you would like to add Value Labels to the individual cells on your heat map, you can toggle on the “Value Labels” option from the Chart Settings under the Series tab.
Additional customization such as background map colors, X-axis and Y-axis titles and detailed annotation labels can be added in the Chart Settings.