This is tip 17 of my Tableau Speed Tipping session. Refer to the Table of Contents to find the other tips.
Shade background using Set Action
Maybe you don’t necessarily want to choose the colour your users can shade the dashboard with. Maybe you want to leave it up to them and give them a rainbow of colours to choose from. This tip was inspired by Kevin Flerlage’s blog post on Parameter Actions (check out 10. Background Color Picker). As I’ve approached the solution a bit differently, I will detail my way here, but definitely give Kevin some love for this brilliant idea.
Setting up the elements
I have created two charts. One is my Colour Picker (the interactive element), the other is my Coloured Sheet (which will function as a background. I could have used a separate helper data source, but I elected to simply refunction a data source I was already using, anyway.
For my Colour Picker, I created a simple pie chart, putting any dimension with a sufficient number of elements on Colour. I don’t need a measure for Angle, as each slice should have the same size. Now I just need to assign the colours I want to my dimension. For simplicity’s sake I’ve chosen the Hue Circle colour palette that comes with Tableau, but you can take whatever colours serve your purpose here.
On to the Coloured Sheet. Place the dimension you used for colours in the Colour Picker onto Colour here, as well. Now double-click in the marks card, create an ad-hoc calculation with MIN(1), and drag the resulting pill to Size. Tableau will create a treemap for you. If your sheet is not showing a treemap, change the marks type to Automatic or Squares.
Staying in the same sheet, create a Set from your dimension on Colour. Add any element to this set and drag the resulting set into the filter.
Putting everything together
Now create a dashboard as you usually would, add the Colour Picker to it, then make everything floating (see Tip 16 for more detailed instructions). Take care that all your sheets on this dashboard have no background colour. Add another floating container and drop your Coloured Sheet into it, adjust sizing and position, then move this container to the back. Now it’s time for interactivity.
Go to Dashboard > Actions > Add Action > Change Set Values. On Hover or Select on the source sheet Colour Picker, you want to target your set, assigning the values to this set. Clearing the selection should keep the set values.
Watch the full process in the following GIF, demonstrated using the Superstore.