We had the idea to create a “lightbox” effect in Tableau while trying to eliminate scrollbars that were cluttering a client’s dashboard. It worked out really well for that project, and we’ve since realized that lightboxes also allow you to expose more detail and mitigate space limitations without feeling like you’ve ever left your dashboard.
Before we get started building out the dashboard, let’s answer a few questions that you might have at this point:
So wait, what’s a lightbox?
Well, it’s a pretty common (and pretty cool!) web design technique used to draw attention to a certain element on a page. You’ve probably seen it in photo galleries where if you click on a photo it expands in the middle of your screen and the rest grays out.
Figure 1: Lightbox example
And why’s a lightbox useful in Tableau again?
Losing the scrollbar!
You know how Tableau automatically adds a scrollbar when a chart has lots of rows? They take up space, and to be honest aren’t very visually appealing.
And if you think most dashboard users will be focused on the top items in a chart, then you might not even want to include the scrollbar at all. But what about those users who do want to see all the rows?
That’s just where creating a lightbox in Tableau can provide a happy medium. It’ll show just the top portion of the chart (without a scrollbar!) on your main dashboard, and then show the full view in a lightbox.
Uh huh. And when else can a lightbox be useful?
Well, what if you want to display only a summary visual at first, and then show more detail if the user is interested? It can be hard to squeeze the detailed visual into the dashboard. You might be tempted to just direct the user to another dashboard, but is it really worth it for only one visual? In this case a lightbox is a great solution!
There are a few main cases where a lightbox might come in handy:
- Remove scrollbars from main dashboard and show full visual in lightbox
- Keep the main dashboard at the same level of detail and show more detailed visuals in a lightbox
- Include a supplemental visual that you don’t have enough space for, but doesn’t deserve its own dedicated dashboard
In this post, we’ll walk you through the process of creating a lightbox and show how we’ve applied this technique to the two cases mentioned above.
As a quick overview of the process, we’ll be creating a main dashboard with the information that we want to display. Then we’ll duplicate that dashboard and use a couple of tricks to create a lightbox effect.
1. Create a dashboard
The first step is creating a dashboard that has a good case for using a lightbox. In the dashboard below, we are displaying information on the number of Facebook likes that movies have.
Let’s take a closer look at the “What are the most liked movies?” chart. Here we want to display a sorted bar chart of the most liked movies, but assume that most people will be interested in just the top few movies. Because of this, we decide to show only the top 10 movies on the dashboard and then create a lightbox to show the full list.
Figure 2: original “how liked are movies” dashboard
2. Create a new version of the “What are the most liked movies?” chart and replace the current chart
This version should only include the top 10 movies! Why 10? It’s an arbitrary number—pick whatever will look good in the space that you have available.
Figure 3: dashboard including new chart (top 10 most liked movies without scrollbar)
3. Duplicate the dashboard
To start the process of lightbox creation, we need to first duplicate the FINAL version of our dashboard (since we’re duplicating the dashboard, any changes that we make from this point onwards will have to be made to both dashboards separately).
4. Create a floating text box
Over the duplicated dashboard, create a floating text box that covers the whole dashboard. Adjust the shading and transparency to your liking to create the grayed out effect for the lightbox.
Figure 4: lightbox dashboard with floating text box
5. Add the full chart in as a floating sheet
Now go back to your chart with the movies listed and add it as a floating sheet on top of the text box. Make sure to add it inside a floating layout container so that you’re able to add a title, border, and any other filters/legends that you would like to include. Add formatting as you like.
Figure 5: lightbox dashboard with chart
6. Add connections from the main dashboard to the lightbox and from the lightbox to the main dashboard
Add connections by creating sheets that will act as backward and forward buttons. These buttons can be text or custom icons. In this case, we’ve chosen to use text.
Here’s the process of creating these buttons (the one to go back to the main dashboard from the lightbox).
- Create a new sheet
- Create a calculated field with the following inside of it (including quotes): “Back”
- Go back to your new sheet and drag the calculated field you just created onto Text
- Click on the Text mark and edit it to be the right color and add an underline.
- Drag this sheet onto your main dashboard, selecting the Entire View option and the Hide Title option
- Create a new dashboard action to go from the “Back” sheet on the lightbox dashboard to the main dashboard
- Add one-click dashboard actions for usability: http://vizpainter.com/never-ending-navigation-buttons-that-deselect-themselves/
And that’s the process!
Here are a couple of additional things to keep in mind:
- Finalize your main dashboard before you create the lightbox dashboard
- Since you’re duplicating it, any edits that you make to the main dashboard won’t carry automatically to the lightbox dashboard
- The whole lightbox creation process is VERY QUICK
- As you’ve seen by the small number of steps!
- Don’t worry if you end up changing something on your main dashboard and need to redo the lightbox dashboard.
You can view the finished dashboard below or here on Tableau Public.
Thanks for reading and happy lightboxing!
Posted by admin