Anastasiya Volgina-Tikhonovich
BI Developer, Vizuators

The Hex maps in Tableau

Hex-maps can be a great tool in your data visualization tool-belt. They can allow you to represent geographic data in a format that focuses less on geographic area and position, giving each sub-region an equal area on the map.
Participation in Makeover Mondays gives an opportunity not only to get a hand in creating dashboards but also to try new non-standard approaches, to be creative, and have fun. A dataset was provided on measuring temperatures around the world from 1833 to 2017 for the MoM (51 week, 2017).

The dataset consists of three measures for one station: the minimum recorded temperature, the maximum recorded temperature, and the absolute difference between them in Fahrenheit. The number of stations with relevant data increases in the dataset every year: there is information for only one meteorological station for 1833 and 12131 stations for 2017.
Create a Hex Map in Tableau
How to Create a Hex Map in Tableau
The question came up — how to show all the stations and their temperature oscillations? Many stations are very close, and it is difficult to understand what changes have been made.

The idea was to combine stations by location and choose the maximum and minimum temperature for this area. To do this, I decided to use the HEXBIN function. Previously, I added a conversion from Fahrenheit to Celsius was added.

Let's Build!

So, for each of our stations, there is a latitude and longitude, based on which the station can be assigned to one or another «basket». Create a new latitude and longitude for «baskets» (bins):
how to create a new latitude and longitude in Tableau
how to create a new latitude and longitude in Tableau

The scaling factor is necessary to correct the size and location of the «baskets» relative to each other. It is configured as follows:
How to edit Tableau parameter

Drag our fields to Rows and Columns and get a map with «baskets». By default, Tableau has set the circle view for our «baskets».
How to Create a Hex Map in Tableau

How to change the shape to a hexagon in Tableau
How to change the shape to a hexagon?
Thus, we have combined our stations. But there was a question of displaying the maximum and minimum temperature.
How to display the maximum and minimum temperature in Tableau
To solve this problem, the idea to divide our hexagon into 2 parts came up: the upper one with the maximum temperature indicator and the lower one with the minimum.
Using the Figma tool, I separated our original hexagon into 2 parts.
Afterward, I added a transparent rectangle to each part. So the size of our whole hexagon was obtained together with the half.
How to display the maximum and minimum temperature in Tableau

Why was it necessary to add a rectangle to the half?

Our two hexagon parts have the exact coordinates, and when building a map through the Dual Axis, they overlap each other. It looks like this:
Therefore, for the two parts to be one above the other, it is necessary to increase the shape's size to the original hexagon's size.
Next, we add color by temperature, customize the tooltips and get our map with maximum and minimum temperatures =)
How to Create a Hex Map in Tableau
How to Create a Hex Map in Tableau
How to Create a Hex Map in Tableau

How to distribute hexagons more evenly?

So, to correct the location, we will go the following way

described in the article.

Convert the coordinates of the web-Mercator to match the projection of the Tableau base map.

Tip
If you want to see 2 measurements at once, use custom shapes.
How to build the Hex Maps in Tableau
Now create a map.

Thus, our hexagons are evenly distributed =)

Hex map dashboard in Tableau

That's what we got!

Explore our possibilities

Use proved Tableau expertise
Choose consultation type

By clicking the button, you agree to the processing of personal data. We use it to stay connected. Read more