How To: Hex Tile Maps in Tableau

11/11/2015 Matt Chambers 32 Comments


Brittany Fong wrote a cool blog post about how to create a tiled map using Tableau.  As soon as I saw it, I started researching the usage of this type of map, and I found an article about hex tile maps.  I knew this was possible in Tableau, so I used Brittany's instructions, and then I manipulated the data to fit a hex map.


First, I added the hexagon shape to the Tableau shapes repository.  Next, I needed to create a file that would align the hexagon tiles to build the hex map.  The file can be downloaded here.  I rearranged the map a bit compared to the article that I referenced.  After I searched Google images for a bit, I found a different layout that was more accurate geographically, so I moved DC out by itself.

Now, to build the hex map:

1. Add Row to Rows
2. Edit the axis for Rows and reverse the scale
3. Add Column to Columns
4. Change the mark to Shapes
5. Choose the custom hex shape that you added to your repository
6. Drag Abbreviation to the label, set the vertical and horizontal alignment to center, turn on allow labels to overlap other marks
7. Hide the headers
8. Adjust the size to get the preferred amount of white space.
9. Add the worksheet to the dashboard and resize until the spacing is correct.  450 by 300 worked well for me.

That's it!  Check out a before and after of a recent Viz of the Day.






32 comments:

  1. Great post! I'm glad I was able to inspire you :)

    ReplyDelete
  2. Ooooooh, so cool! Love it!

    ReplyDelete
    Replies
    1. Thanks Kelly, that means a lot coming from you. It was so nice to meet you in Vegas!

      Delete
  3. Stunning! Thanks for sharing!

    ReplyDelete
  4. I tried this out, but I had to rotate the hexagon png you linked to to replicate results.

    ReplyDelete
    Replies
    1. Thanks, for pointing this out! I completely forgot I had to rotate it. I have added a link to a rotated version.

      Delete
  5. Hi - just an update. I went through the instructions and you should add that you need to do a reversed scale on row for this to work properly!

    Dustin

    ReplyDelete
    Replies
    1. Thanks for pointing this out. I did indeed forget that step. I have updated it.

      Delete
  6. Hey Matt, would you be interested in posting some of your beautiful visualizations such as this one to my open data site (Datazar.com)? Datazar’s mission is to make available all of the world’s open statistical and experimental data. We also love amazing visualizations like this. We could even set up a SirVizAlot hub for you so you can have your own spot to post your content. You would be completely free to link the source of your content back to this blog and obviously it would be completely free for you to use our platform. Let me know!

    Brian

    ReplyDelete
  7. I did the same thing two months earlier with a different state layout:
    https://public.tableau.com/profile/krislikesmath#!/vizhome/USStateHexmapAccidentDeaths/HexStateMap

    I also have a rounded hexagon for anyone who's interested.

    ReplyDelete
    Replies
    1. Also, kicking DC out to the side probably is the best option. It avoids the log-jam in the North-East

      Delete
    2. Nice work Kris! I hadn't seen your version before.

      Delete
  8. This is excellent. Thanks. I'm sending my art people to this blog immediately.

    ReplyDelete
  9. I'm late to this party. Nice work and thanks for sharing the shape file and spreadsheet. That was a time-saver.

    ReplyDelete
  10. This is really great. I have one question: I can't seem to get the states on the corners to fully display; no matter what I do with sizing, they get cut off. I've tried them as discrete, continuous, dimensions and measures. And I cannot edit the axis to make it fixed. This must be something really simple I'm overlooking. Any ideas?

    ReplyDelete
    Replies
    1. Hey Jon, could you publish your workbook and let me take a look? I'm not sure what it could be. I used automatic on my axes, and it worked. Do you have include zero on?

      Delete
  11. This is Good for me... Thanks for sharing.... Tableau online training

    ReplyDelete

  12. your blog is such a wonderful and nice library which filled with lot of technical stuff please share with us
    http://www.sbrtrainings.com/tableau-training.html

    ReplyDelete
  13. Thanks for the useful tips. I couldn't find anyone who'd tackled the map of Europe this way, so I've had a go myself. Data and some commentary are here: http://statsexplorer.blogspot.be/2016/03/tile-based-maps-and-service-unit.html .

    ReplyDelete
  14. Dear Matt.

    The Technique and methods which you used is really tremendous. Its our privilege to have you .Your every blog post is unique and you are teaching something new to others. Keep up the Good work and keep guiding us with your tableau Skills

    ReplyDelete
    Replies
    1. Thanks Rajeev! Glad you found it useful.

      Delete
  15. Matt,
    I, too, am a Tableau newbie. But I've been making progress. I very much want to make hex maps part of our exhibit tool kit. Using your instructions and links I have my first hex map just about where I want it. Two problems remain. Most grateful for any tips. 1) State abbreviations are lining up below each hex cell and I want them inside the cell. How might I fix? 2) How do I reduce the amount of white space between cells to get them nice and snug next to one another as in your example?

    Thanks
    Larry Wheeler
    Managing Editor
    Health Affairs
    lwheeler@projecthope.org

    ReplyDelete
    Replies
    1. Hi Larry! Thanks for reaching out. Make sure your labels are centered horizontally and vertically, and that should line them up the way you are expecting.

      Getting rid of the white space is tricky. Most of it is trial and error resizing the hex shapes and the worksheet in the dashboard to get it to look nice. I found 450x300 worked for my hex map on this dashboard https://public.tableau.com/profile/matt.chambers#!/vizhome/BodyCameraLaws/BodyCameraLaws

      Delete
    2. Thanks for the quick response. I'll poke at it some more and see if I can get it to behave. Have a good weekend.

      Delete
  16. Elegant solution. Creative and simple approach. Big impact!

    ReplyDelete
  17. Great idea. Thanks for sharing the proper explanation about how to create Hex Tile Maps using Tableau. I found one more good resource related to Tableau which i am sharing with you it will give you detailed knowledge of Tableau Just have a look at this link: https://intellipaat.com/tableau-training/

    ReplyDelete
  18. I just came onto your post and found it quite interesting. I am also associated with Tableau Support, Tableau Consultant, Tableau Admin, Tableau help, Tableau Services and love to enjoy the stuff on the same as its rarely found on internet. Thanks again for writing such a good post.
    Tableau Support

    ReplyDelete
  19. Thank you for the post Matt. How do you go about creating the row and columns for UK if I wanted to do something similar? Appreciate your help and support. Has anyone created the row, col co-ordinates for UK region?

    ReplyDelete
    Replies
    1. It was just trial and error to arrange them the way I wanted. Yes, Ben Moss created the UK version: http://www.thedataschool.co.uk/ben-moss/vizlikeanartist-hex-mapping-in-tableau/

      Delete
  20. Hi Matt,I have one question about the data. Which tool can I use to get the grid map data?

    Appreciate your help and support.

    ReplyDelete

Note: Only a member of this blog may post a comment.