Tutorial – SVR – Senator Tree Map
Last week we showed you how to create the data set for our Senate Voting Records Dashboard. This week we are going to use that data set to create the Tree Map that lets you select each Senator.
First we will want to open a new Tableau workbook and connect to our Excel file.
Once you have select the workbook, it should automatically select Sheet1 (if it does not, go ahead and click and drag the correct sheet into the section that says “Drag sheets here”). You should have something that looks similar to the image below.
Once you have the source data selected, go ahead and click on the Sheet1 tab at the bottom of the window. This will bring you to a blank view.
The next step is to bring all of the necessary Measures and Dimensions into the Marks shelf. For this visual, we will need the First Name, Last Name, Lis Member Id, State and Party Dimensions. The only Measure we will need is Number of Records (as SUM). State and Last Name will be Text marks, Lis Member Id and First Name will be Detail marks, Party will be a Color mark while Number of Records will be the Size mark. Once you have the correct Dimensions and Measure on the correct mark types, go ahead and adjust the order of the pills to the following: State, Last Name, SUM(Number of Records), Party, Lis Member Id, First Name. Your Marks shelf should match the image below.
Now that we have our main visual set up, we will want to apply some formatting. Start by changing the font and font size to allow the Senator names to fit into each box. Simply click on the Label box in the Marks shelf and then click on the Font menu. For this visual we used the Tahoma font with a size of 7.
The next formatting change we want to make is to Color. Click on the Color box on the Marks shelf and under Effects, click the Border menu to select None.
Once that is done, we can edit the aliases for the Party dimension to show the full party names rather than a single letter. You can do this by right clicking on the Party dimension pill and selecting Edit Aliases. This will open the alias window which will let you put in an alias for each of the values in the data source.
Now that we have created aliases for our dimension, we can modify the color palette. Double click in the color legend box to bring up the palette window. For this we used the Tableau Classic 10 color palette and select Red for Republican, Blue for Democrat and Gray for Independent.
The last thing we want to update is the Sheet Title. At the top of the visual, there should be a title section that says Sheet 1 (if it is not visible, click on the Worksheet menu on the top toolbar and select Show Title). Double click the title to open the Title window. For this dashboard, our titles are using the Trebuchet MS font with a font size of 10.
Once that is complete, you should have a view that looks like the one below. This will be our primary visual for selecting a Senator to view their individual voting record.
Check back in about a week for our next tutorial, where we will create the next part of our dashboard!