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 places less focus on geographic area and position, giving each sub-region an equal area on the map.
Participation in the 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 for 12131 stations for 2017.

The question came up — how to show all the stations and their temperature oscillations? Many stations are very close to each other, and it is quite difficult to understand what changes have been made.
There was an idea to combine stations by their location and choose the maximum and minimum temperature for this area. To do this, I decided to use the HEXBIN function. Previously, 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):

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


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 change the shape to a hexagon?
Thus, we have combined our stations. But there was a question of displaying the maximum and minimum temperature.
To solve this problem, the idea to divide our hexagon into 2 parts came up: the upper one with the maximum temperature indicator, the lower one with the minimum.
Using the Figma tool, I separated our original hexagon into 2 parts.
After that, I added a transparent rectangle to each part, so that together with the half, the size of our whole hexagon was obtained.

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

Our two parts of hexagon have the same 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 size of the shape to the size of the original hexagon.
Next, we add color by temperature, customize the tooltips and get our map with maximum and minimum temperatures =)
How to distribute our 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.
Now create a map.

Thus, our hexagons are evenly distributed =)

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