How To: Hex Tile Maps in Tableau

11/11/2015 Matt Chambers 39 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.






39 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
    Replies
    1. Thanks, I hope you find it useful!

      Delete
  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. Hello, I love reading through your blog, I wanted to leave a little comment to support you and wish you a good continuation. Wish you best of luck for all your best efforts.
    Tableau Guru
    http://www.sqiar.com/services/tableau-software-consultants/

    ReplyDelete
  6. 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
  7. 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
  8. It's actually a cool and useful piece of info. I am glad that you simply shared this useful info with us. Please keep us up to date like this. Thanks for sharing
    Tableau Guru
    http://www.sqiar.com

    ReplyDelete
  9. 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
  10. This is excellent. Thanks. I'm sending my art people to this blog immediately.

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

    ReplyDelete
    Replies
    1. No problem! Glad you found it useful.

      Delete
  12. 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
  13. This is Good for me... Thanks for sharing.... Tableau online training

    ReplyDelete

  14. 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
  15. 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
  16. 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
  17. 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
  18. Elegant solution. Creative and simple approach. Big impact!

    ReplyDelete
  19. 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
  20. 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
  21. 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
  22. 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
    Replies
    1. Hi, it was trial and error to arrange the xy coords the way I wanted.

      Delete
  23. ​​A1Trainings Offers
    Tableau Training in Hyderabad by real-time experts for more details visit:a1trainings.com Phone: +91 7680813158 Email: contact@a1trainings.com​





    ReplyDelete
  24. Matt

    This is fantastic. Thank you!

    I have just used it to create a map of Egypt's provinces during the Old Kingdom (i.e. around 2500BCE) to plot data for my wife's thesis. Needed a fair bit of work to map out the provinces (which are basically following the length of the nile, with a province on each side).

    It looks really good, but I have one problem - I have some provinces with zero data. They don't show up at all (just white space - like the gap between WI and MI in your map, except in my example there is a Province there that I would like to show its Name, and show that there is no data). Ideally what I would have would be either:

    . an outline around all the shapes that has no fill colour in it and just shows the Name of the province (equivalent of your Ab in your American map). To do this I think I would need all the shapes to have an outline, and then a fill colour, and I have no idea how to do that)

    or

    . when I put the number of items to colour, it include 0 as a possible value, and therefore the range of colours starts from a very light shade of my selected colour being a value of 0, not 1 as it currently is

    Do you know if this is possible?

    Thank you


    Victor


    Victor

    ReplyDelete
  25. I solved the problem

    In my case, the database join between my data and my Province (State) names / Long/Lat references was a Left Join. Consequence was that not data came over for the Provinces with 0 data (i.e. not even the Province name / Abbreviation).

    By making it an Outer Join, problem fixed - I now have Provinces with 0, and they come out the lightest shade of my selected colours.

    Thanks again for the Viz



    Victor

    ReplyDelete
  26. Really useful and insightful blog! Thanks for sharing.
    Tableau Online Tutorial is a central foundation to any ace who needs to get into the Data representation field and comprehend it better. https://goo.gl/qFKyLf

    ReplyDelete