Tile Grid map with bar chart and labels in Tableau

Priya Yogendra Rana
5 min readAug 14, 2021

--

US Tile Grid Map with Bar Chart and Labels (Pic by Author)

Having a bar chart in a tile grid map looks good but it becomes aesthetically rewarding if the states’ names are also reflected in the chart for geographically challenged users. Let’s discuss how to do it.

When the #MakeoverMonday challenge for Week 30, 2021 was announced, I had no idea what tile grid map was. Of course, the net came to my rescue and I found this link which detailed how to make a tile grid map of the US. If you follow the link to the letter, you will find that you have to simply plot everything on X and Y axis i.e. Rows and Columns respectively. Note: if you already know about Tile Grid Map, skip below till Placing fields on the sheets section.

Once you have understood the content in the link and gathered the data, you will realize that you have three columns — Row, Column and State. There will be 53 rows in total including the column header. Reason being, the makeover challenge included Puerto Rico, even though it’s not a part of the US. I have added a column called State Abbreviations, which basically contains abbreviations of US State.

Your dataset will probably look like this <Refer Fig 1 and Fig 2>.

Fig 1 and Fig 2 (Pic by Author)

Now, open the prepared excel or CSV sheet of the tile grid map in Tableau.

Now we will proceed to the main dataset which contains the data to be analyzed. Link to the dataset. Go to Data Source and click on ADD next to connections and add another file — the main dataset file. In this particular case, there were eight columns –State and seven columns of different races residing in States along with their percent. Drag the sheet in the file to establish the connection with the tile grid map dataset file. Here, the State Column in both the dataset makes it easy to establish a connection between the tile grid map and this dataset.

Now we have to tame the dataset So, select all seven race related columns, right click and go for ‘Pivot’ option. This will lead to three columns now — State, Pivot.Pivot Field Names and Pivot.Pivot Field Values. Rename the latter two to Race and Values (%).

Placing fields on the sheet

First check whether the Row and Column in the tile grid map dataset are in the dimensions section. If not, then move them from the measures to dimensions. Now, plot the Row in Rows bar and Column in Columns bar and keep them as Discrete <Refer Fig 3>.

Fig 3 (Pic by Author)

Place the ‘Race’ field next to the Column, and Value (%) next to the Row. This will give a bar chart in the location of states. You may notice nulls on the bottom right side of the sheet. Right click and select ‘Hide Indicator’. You can left click and select the ‘Filter Data’ option as well. Then, right click individually, on all four fields in the Rows and Columns in the Rows and Column bar above and uncheck ‘Show the Header” option <Refer Fig 4>.

Fig 4 (Pic by Author)

Now to create a block below the bar chart, we need to create a calculated field (let’s say ‘calc field’) having — MIN(0) and place this next to Value (%) in the Rows bar. Or you can directly type MIN(0) in the Rows bar by double-clicking the space beside the Value (%). You will see something like a dotted line, under the bar charts of each state. Format and remove the unwanted lines.

Go to the AGG(calc field) in the Marks Card, change from ‘Automatic’ to ‘Square’ and adjust the size according to your requirement. Please note that you can also select circle, line, bar, shape, pie, Gantt bar and density instead of Square from the drop down. Here, I will opt for Square and adjust to the level where I can get something like a long straight rod <Refer Fig 5>.

Fig 5 (Pic by Author)

Place the ‘Race’ field in the Color card of SUM(Value (%)) and click on the descending sort button in the bar above. Place State from the tile grid dataset and place it in the Color Card in AGG(calc field). A dialog box will pop up. Select the option ‘Filter and then add’ option. Then select the ‘Use All’ radio button. Just ensure no states next to each other are of the same color <Refer Fig 6>.

Fig 6 (Pic by Author)

Then comes a slight boring task. Annotate any one square of each state with the state abbreviation or the state name. Now, your graph is ready.

I hope this helps. Link to the visual for reference. You will also find Tile Grid map with treemap in the same.

--

--

Priya Yogendra Rana

Ex-Software Developer, MBA, Data Analyst Enthusiast. Bring together business focus and data skills