Tableau Tips: How to swap between background images using a color picker chart in Tableau?

Priyanka Dobhal
4 min readApr 21, 2021

--

I used this technique in one of my IronQuest viz on Movie Calendar 2021.

Initially, I had created this in yellow but I had my eye on a few other colors. That’s when I got an idea to add an option to swap in Tableau.

This is the final view that we are aiming to build.

Let us jump in! :)

Design

We first need the images that we’ll be using in our dashboard.

I created them in AdobeXD but feel free to use any other tool of your choice.

I created 4 different background templates of each of the colors.

So now that I have the images in place, it is time to move to Tableau.

Implementation in Tableau

I created one worksheet for each template so in this case 4 worksheets.
To add an image as a background image, we’ll need an axis on row and column.
I used a dummy calculation to get this

[Number of record] is added to row and column.

The axis width and height need to be based on the size of the image.
To know that, right-click on the image and go to properties. Under that, you’ll find Details (left image). Your axis needs to fix at the mentioned width and height (right image).

Now to add a background image on Tableau,
Maps → Background Images → Data Source name

Vola! Similarly, add the other 3 images.

When you click OK, you should see something like this.

I duplicated the worksheet and created another 3 for each color.

Please be mindful that only one Background image is to be selected in each worksheet.

Color Picker

Well, you can also use a simple parameter drop down but I wanted to make it look like a color wheel which brought me here.

Copy and paste the below text in tableau. This will create a new data source clipboard.

Color
Blue
Green
Yellow
Purple

Create a worksheet with a pie chart of the colors. I have assigned the color same as the ones in the images.

Now create a parameter to capture the color name selected.

Dashboard

Place all the Background worksheets in the dashboard in a container to let them collapse (hide the title and axis).

We will need a parameter action on this worksheet to select the color.

To add these values to the filter, we’ll create a calculated field — [Color Selected]

This is then added as a filter on all the worksheets. Select one color in each.

And you’re done! I hope you were able to follow along with the instructions.

You can even find this workbook on my Tableau Public Page:
How To: Swap between Background Images — Priyanka Dobhal | Tableau Public

Feel free to download and try it yourself.

Did this help you? Would love to hear from you.

Thanks for the read :)

--

--

Priyanka Dobhal
Priyanka Dobhal

Written by Priyanka Dobhal

An introvert, tiring to break out of my Cocoon. Turns data into visual: https://public.tableau.com/profile/priyanka.dobhal0993#!/

Responses (1)