Custom Shapes in Tableau

01 Sep 2016

3 Great Ways to Use Custom Shapes in Tableau

Ryan Smith

In this blog post, I will take you through 3 different use cases for customised shapes, while showing how I built my example dashboard "Marvel Film Analysis", that you can find at the end of the post.

To customise shapes in Tableau, the first thing you need to do is to save the images you want to use in the folder where Tableau store shape files by default: Documents > My Tableau Repository > Shapes

After the pictures you want are in the repository, you can begin to use them in your dashboards. 

1 - How to Use shapes as marks

Using shapes as marks is the intended purpose for Custom Shapes within Tableau, and it allows you to use an identifier other than colour or a label.

To do it, drag and drop your preferred dimension onto the Shapes option on the Marks Card. This will allow you to use custom images as points on a scatter plot or as marks in an infographic.

In my example, I have used custom marks in a scatter plot as my points on the graph. I have also used custom marks as an "Infographic" to show the ratings for each of the films using the logo from the review websites.

I decided to customise my shapes according to the film franchises they occur in so that films could be easily identifiable by their look. To do this, I dragged "Franchise" onto Shape on the Marks Card.

Figure 1. Franchise on the marks card

The next step was to assign the shapes to their corresponding data item. To do this, I double-clicked on shapes to open the "Edit Shape" window. Here I navigated to the folder in the "My Tableau Repository" and assigned each image to its data item. If the folder or shapes do not appear at first, click "Reload Shapes" to refresh the images in Tableau.

Tableau Shape Selection

Figure 2. Shape Selection IN TABLEAU

After selecting the shapes, I clicked "Apply", then "OK", and my new shapes were then visible on the chart.

Tableau Franchise logos as Shapes on line chart

Figure 3. Franchise logos as Shapes on Line Chart

2 - how to Use shapes as Buttons

Tableau doesn't offer an inbuilt button functionality to perform tasks such as Filter, Highlight or Change Sheet, but we can achieve these through the use of Custom Shapes. Unlike Custom Marks, this is a workaround and not the intended function of shapes in Tableau, which means we have to do quite a few things to configure them correctly.

In my example, I have used the same custom shapes as my marks, only this time I used them as buttons to filter my scatter plot. I have also used arrows as page turners to navigate between my dashboards.

To use buttons as filters, add your desired filter onto the columns shelf. To filter by Franchise in my example, I moved that dimension onto columns, as can be seen below.

Franchise as column headers

Figure 4. Franchise as column headers

To add shapes to the Franchise filter, I changed the mark type to "Shape" then put the desired filter on "Shape" in the marks card.

Figure 5. Shape as marks type and Franchise on shape

Figure 5. Shape as marks type and Franchise on shape

Figure 6. Our new column header with Logos of franchises

Figure 6. Our new column header with Logos of franchises

Although these are clickable, for them to filter data I needed to apply dashboard actions first. The dashboard actions can be found in the dashboard dropdown under Actions, where you can add Filter, Highlight and URL actions to your dashboard.

I have decided on the Highlight action and chose to activate it only when the mark is selected. I have also chosen which sheets will be affected (Target Sheets), and where the action will originate from (Source Sheets). 

Figure 7. Highlight Action option window

Figure 7. Highlight Action option window

You can see the results below.

Figure 8. Tableau Buttons highlighting marks

Figure 8. Buttons highlighting marks

3 - HOW TO Use shapes as Filterable/Dynamic images

Tableau comes with the option to include images and even web pages in your dashboard. These images are not dynamic, and the web pages come with a few drawbacks (the need for an internet connection is a big one). To get around this, we can use custom shapes to become our dynamic and filterable images.

In my example, I have used the movie cover as my custom image, allowing me to select "Film" for the movie cover to be displayed dynamically.

Here is how I did it:

As I was going to use different shapes for this part of my dashboard, I created a separate folder in "My Tableau Repository" for my images. Very similarly to the button, I needed to add a data item for each of my shapes.

After I had a shape for each film, I dragged and dropped "Film" to the rows shelf. To add the movie covers to each correspondent film, I selected shape as my mark type then dragged and dropped "Film" onto Shape.

Next, I followed the steps from earlier to assign my shapes to their corresponding data items.

The following step was to add a filter so only the correct shape was shown - the shape shown would change depending on the selection. This is again done using dashboard actions, which can be found in the dashboard dropdown. My choices now were slightly different from before as this time I wanted to filter as opposed to highlight. The options are shown below.

Figure 9. Tableau Filter Action option window

Figure 9. Filter Action option window

The important things to note here are the Sheets selected for source and target, as well as the "Exclude all Values" option, which has been selected. This means that once something has been unselected, nothing will be shown as opposed to all the covers being visible.

Figure 10. Film cover shown matches selection

Figure 10. Film cover showed matches selection

Top tips for Custom Shapes

PNG – Use PNG files if possible as that removes the background, making the images more appealing.

Don't overdo it – Too many pictures can make your dashboard look messy and cluttered.

Grouping – Shapes are best used to group data, having a different shape for each data point is pointless.

Legends are history – Although your pictures may be recognisable to you, a legend may be needed to clarify their meaning. This can be solved by using your shapes as a Filter accompanied by names.

Sizing is key – Try to select same size shapes if they are going to be used together. Also, try to get good resolution images (though all shapes are scaled down in Tableau, a higher resolution will stop your shapes becoming pixelated).

Naming – Save custom shapes to "My Tableau Repository" with relevant names, this will help when assigning them to data items. If your shapes are in the same order as your data items, the "Assign Palette" button will take care of the sorting for you.

Ryan Smith

About the author

Ryan Smith is a Graduate Analytics Consultant at Concentra. He studied Computer Networks at the University of Portsmouth and has a love of all things technical combined with a growing love of data. He believes that, together, these two can bring great insights into fascinating and exciting areas of everyday life. Sports is his main passion, and he enjoys visualizing all types of data from Football to MotoGP.

Related to 3 Great Ways to Use Custom Shapes in Tableau