Tableau Tips - Volume 13 "Another 10 tips for Viz in Tooltips"
(Now available in Tableau 10.5)

Tableau 10.5 was released yesterday and we now have viz in tooltips. I wrote a blog post in October 10 Tips for Viz in Tooltips. There has been lots of buzz about the new release. Jade Le Van tweeted "you might feel like there's nothing new to come up with" here. I knew the community would continue to find all sorts of new things. That's the beauty of Tableau, even experts who use Tableau every day will still stumble on new tips and tricks. The Tableau community is filled with so many talented people and it's amazing how the community builds upon one another's ideas. I am especially excited to have new features like Viz in Tooltips, because it usually opens the door to many more things, often far beyond what the developers at Tableau planned for a given feature. Last night I opened Tableau 10.5 and began exploring the new Viz in Tooltips feature again, so I thought I would write up another post with another 10 tips on using Viz in Tooltips. I'm sure the community will discover many more fun uses.

Note, these tips build on each other, so be sure to read them all in order.

#10 - Add an Empty Sheet with Maxheight=9

In my previous post, tip #3 used an empty sheet with a background color to add a border line in the tooltip. As we learned, we can change the maxwidth and maxheight for the tooltips. You can't change the maxheight to zero, so in my previous tip #3 we set it equal to 1. However, any value less than maxheight="9" will create a message on the bottom of the tooltip "View is too large to show". You can avoid this error message by using maxheight="9" or higher. This is a good solution, but it creates a larger border line in the tooltip when set to 9.


Earlier tonight Pooja Ghandi tweeted another great example. She crafted a beautiful tooltip "card" in a tooltip by using min(1) to create a title for each card that filters dynamically with the tooltip.

#9 - Add an Empty Sheet and Use Row Divider to Create Lines in Tooltip

For this tip, we will use a blank sheet again, but this time we will use the Row Divider on the sheet. Use tip #10 and set the maxheight=9 so the warning is avoided. Instead of using the background color of the sheet for the border, like we do with a text box trick to create a line, use the row divider instead. You can set the Row Divider to any thickness, color or style. You will now have a clean line divider that is completely customizable and no warning box for the tooltip size.

#8 - Create a Workbook with All of Your Formatted Lines

Since you can copy and paste worksheet formatting from one Tableau workbook to another, you can create a workbook with many tabs for all the different styles and colors of your tooltip borders. Then simply pick the border that you want, copy the sheet formatting and paste the formatting to your new worksheet in any workbook.

#7 - Use an Empty Sheet to set Maxwidth and Maxheight for the Tooltip

Pay attention to this one. This is an important tip and will help us accomplish some of the tips below. We can do this with or without a Row Divider. In other words, you can have a very long border line in the tooltip or you can match the background color and this sheet will be invisible. This is an important step, because we can use this empty sheet to set the width of the tooltip, independent of anything else we put in the tooltip. For example, we can set this empty sheet to Maxwidth=600, but another sheet can be added with Maxwidth=300. Make sure the empty sheet has a Maxheight=9, like we did in Tip #9, to avoid the sizing warning.

#6 - Center or Right-Align the Viz in Tooltip

Just like text in a tooltip window, you can align the code for the embedded sheet in the tooltip. Simply, highlight the embedded code and align it to the center as you would text. Use with tip #7 and you can have a wider tooltip, with a chart centered in the middle.

#5 - Use the Same Empty Sheet Again in the Same Tooltip

Once you've used a sheet in a tooltip, that sheet is no longer available in the list of sheets in the tooltip. Notice in the screenshot below that the Blue Border is grayed out because it is already being used in the tooltip.

This is easy to resolve though. Simply copy and paste the embedded code for the sheet you want to duplicate. In this case, I simply copied and pasted the line of code for the Blue Line sheet to get a second line. This is handy because one sheet can be used over and over again to save time.

Now we have have multiple lines in the tooltip simply by using a single worksheet.

#4 - Create a Side by Side Chart

Using Tip #7 above, we can set the maxwidth to a wider size than the charts. For example, setting the maxwidth=600 will create a wide tooltip. Then you can can have two charts side by side in the tooltip by setting each one of those to a maxwidth=300. Set both of those sheets (the ones with the chart) to Entire View and each one will take up maxwidth=300. Placing the code side by side in the tooltip will place each of them next to each other taking up 50% of the total maxwidth.

#3 - Adjust the Size of the Tooltip Window using Parameters

Similar to Tip #1 in my previous post, we can use a calculated field to create a string for our viz in tooltips. This allows us to use parameters to adjust the maxwidth and maxheight of the tooltip. I'm not sure a user will want to adjust the size of the tooltip on the fly, but this might be useful for someone developing a workbook. It allows for quickly sizing and resizing without opening up the tooltip window and adjusting the maxwidth and maxheight manually.

Step 1: Create Two Parameters
Tooltip Width - an integer that you can use to set the width of the tooltip window.
Tooltip Height - an integer that you can use to set the height of the tooltip window.

Step 2: Create a Calculated Field
Create a calculated field that will combine the string, replacing the hardcoded sizes in the tooltip with the values of the parameter.

Calculated Field Name: Tooltip Code
'<Sheet name="Sheet 22" maxwidth="' + str([Tooltip Width]) + '" maxheight="' +str([Tooltip Height])+ '" filter="">'

Step 2: Add the Calculated Field to the Tooltip Place the calculated field on the Tooltip in the Marks Card. Then add this new field to the Tooltip in place of the viz code.
ATTR(Tooltip Code)

You now have a tooltip that can be resized using the parameters for width and height. You could use this same concept for sheets as well.

#2 - Use the Viz in Tooltip as a Zoom Feature

You can size the viz in tooltip to be the entire size of the screen. If you size too much then the viz in the tooltip won't render. You can use Tip #3 to figure out the best size for your zoom. In this example, I have a small state map. The viz in tooltip is the same view, but sized very large. This acts as a zoom in feature for the original map. You might think that with an over-sized tooltip that it would be impossible to leave the tooltip once it's open, but Tableau remembers the mouse position as it relates to the underlying visualization, so when you move your mouse the viz will update or disappear, just as it would without the full screen tooltip.

#1 - Put Multiple Charts Together in a Grid

Similar to the side by side charts in Tip #4, we can put all sorts of sheets together to create different views. For example, the image below is a highlight table with a marginal histogram. This is 3 different charts placed in the tooltip. Instead of having the Row Divider on the blank sheet colored, it's simply set to the background color or to None so that it's invisible in the tootlip.

First, create each chart and then place them in the tooltip in a grid format.


Region: <Region> <Sheet name="White Border" maxwidth="600" maxheight="9" filter="<All Fields>">
<Sheet name="weekday histo" maxwidth="500" maxheight="100" filter="<All Fields>">
<Sheet name="highlight table" maxwidth="500" maxheight="500" filter="<All Fields>"><Sheet name="month histo" maxwidth="100" maxheight="480" filter="<All Fields>">

Tooltip Layout

Here is an illustration of how this tooltip is setup (Click on image below to enlarge).

Once the layout is set, the charts can be adjusted as needed. I set the maxheight=480 for the monthly histogram. For the weekly histogram I used the header to line things up and then made the font white to match the background color. This enabled me to line up the histogram with the highlight table.

Here's the final tooltip in action.

I hope you find this information useful. If you have any questions feel free to email me at Jeff@DataPlusScience.com

Jeffrey A. Shaffer

Follow on Twitter @HighVizAbility