How to Add a Graph in Tooltip in Tableau
Adding a chart inside a tooltip in Tableau is a simple technique that can make your dashboards dramatically more insightful and interactive. Known as a "viz in tooltip," this feature lets you embed one worksheet inside the tooltip of another, providing rich, contextual detail right where your users need it, without cluttering up your main dashboard view. This guide will walk you through exactly how to set it up, from creating the necessary worksheets to refining the final result.
Why Bother with a Viz in a Tooltip?
Before we jump into the "how," let's quickly cover the "why." Putting a visualization in a tooltip isn't just a neat visual trick, it serves a practical purpose that genuinely improves your dashboards.
- Provides Context on Demand: The biggest advantage is delivering deeper insights without any extra clicks. Users can hover over a single data point - like total sales for a state - and immediately see a trend line or a category breakdown for that specific state. It answers the next logical question directly in the flow of analysis.
- Saves Prime Dashboard Real Estate: Dashboards can get crowded fast. Instead of trying to squeeze in several small charts to show different levels of detail, you can tuck them away inside tooltips. This keeps your main view clean, focused, and easy to read.
- Enhances the User Experience: Interactive elements make dashboards more engaging. A viz in a tooltip encourages users to explore the data by transforming a static number into a dynamic entry point for more information.
The Core Concept: Source and Target Sheets
To create a viz in a tooltip, you need two separate worksheets in your Tableau workbook:
- The Source Sheet: This is the main visualization your user will interact with. It's the chart they will see on the dashboard and hover over to reveal the tooltip. Think of a map showing sales by country or a bar chart of profit by product category.
- The Target Sheet: This is the visualization that will appear inside the tooltip. It should be designed to display more detailed information related to the data point being hovered over on the source sheet. For example, if your source sheet is a sales map, the target sheet could be a line chart showing the monthly sales trend for the selected country.
The magic happens when you connect them. When a user hovers over a mark on the source sheet (like the bar for "California"), Tableau automatically passes that context to the target sheet and filters it to show data for California only.
Step-by-Step Guide: Building Your First Viz in Tooltip
Let's build a classic example: a map of U.S. sales where hovering over a state reveals a line chart of that state's sales trend over time. We'll use the Sample - Superstore dataset that comes with Tableau.
Step 1: Create the Source Sheet (The Map)
First, we need our primary visualization. This will be a simple map showing total sales per state.
- Open a new worksheet and name it "Sales Map."
- Double-click the State field from the location data. Tableau will automatically create a map and place longitude and latitude on the Columns and Rows shelves.
- Drag the Sales measure onto the Color card in the Marks pane.
- Drag another instance of Sales onto the Label card in the Marks pane to show the total sales figures on the map.
You should now have a choropleth map where each state is colored based on its total sales, with the total value displayed as a label.
Step 2: Create the Target Sheet (The Trend Line)
Next, we'll build the line chart that will appear inside the tooltip. This sheet will show sales trends over time.
- Create a new worksheet and name it "Sales Trend."
- Drag Order Date onto the Columns shelf. Right-click it and select the continuous Month option (the one with the year, e.g., MONTH(May 2024)).
- Drag Sales onto the Rows shelf.
This gives you a line chart showing your company's total sales across all states for every month. When we use this in our tooltip, Tableau will automatically filter it down to the specific state you're hovering over on the map.
Step 3: Clean Up the Target Sheet
A viz in a tooltip is small, so you need to format your target sheet to look clean and simple. Extraneous elements like titles, axes, and headers will just create clutter.
- Hide the Title: Right-click the title of the "Sales Trend" sheet and select "Hide Title."
- Hide Headers/Axes: Right-click the "Month of Order Date" axis at the bottom and uncheck "Show Header." Do the same for the "Sales" axis on the left.
- Adjust the View: In the toolbar at the top, change the view from "Standard" to "Entire View." This ensures the line chart will fill the space allotted to it a little more cleanly within the tooltip.
Your "Sales Trend" sheet should now be a very simple, minimalist line chart with no text around it.
Step 4: Connect the Sheets via the Tooltip Editor
This is where we bring everything together. We'll go back to our source sheet and tell it to use our target sheet in its tooltip.
- Navigate back to your "Sales Map" worksheet.
- In the Marks pane, click on the Tooltip card. This will open the Edit Tooltip window.
- The editor shows the text that currently appears in your tooltip. You can add, remove, and format text here. Position your cursor where you'd like the line chart to appear. For a clean layout, you might put it on a new line after the state and sales information.
- At the top right of the editor, click the Insert button.
- From the dropdown menu, go to Sheets > Sales Trend.
Tableau will insert a small piece of code that looks like this:
<Sheet name="Sales Trend" maxwidth="300" maxheight="300" filter="<,All Fields>,">
Click OK to close the editor.
Step 5: Test and Refine Your Viz
Now for the fun part. Hover your mouse over any state on your map. You should see the standard tooltip information (state name, total sales) along with the "Sales Trend" line chart, neatly embedded and filtered to show the sales trend for just that state. It's that easy!
You can go back into the Tooltip editor at any time to make adjustments:
- Resize the Viz: To make the chart larger or smaller, change the maxwidth and maxheight values directly in the code snippet. Try maxwidth="400" and maxheight="200" for a wider, shorter chart.
- Edit Surrounding Text: Feel free to add headers or explanatory text within the tooltip editor to give your viz more context. For example, you could add the title "Monthly Sales Trend" just above the inserted sheet code.
Best Practices for Effective Use
Creating a viz in a tooltip is straightforward, but making it effective requires a bit of thoughtful design.
- Keep the Target Viz Simple: Tooltips are meant for quick glances. Use simple chart types like line charts, single-color bar charts, or highlight tables. Avoid anything that requires a lot of effort to interpret, like a complex scatter plot.
- Optimize for Performance: If your target worksheet is very complex and has to query a massive amount of data, it can cause a slight delay before the tooltip appears. For the best user experience, keep the underlying query for the target sheet as simple as possible.
- Manage Filtering Precisely: The default
filter="<,All Fields>,"works well most of the time. However, if your source sheet has many dimensions, you might want to filter only by a specific field. You can do this by editing the filter attribute, likefilter="<,State>,", to ensure Tableau only passes the State field to filter the target sheet. - Consider Your Axes: By default, the axes on your target sheet will be dynamic, meaning they'll resize based on the data for each specific state. This is usually what you want, but if you need to compare states on a consistent scale, you might consider setting a fixed axis range on your target worksheet.
Final Thoughts
The viz in tooltip feature is a fantastic way to add layers of detail to your Tableau dashboards, making them more powerful and engaging for your audience. By following the source-and-target sheet method, you can provide rich, interactive context right where it's needed, helping users move from "what" to "why" in a single hover.
Mastering tools like Tableau often involves learning dozens of small but powerful features just like this one. If your goal is to simply connect your data and get answers quickly, however, wading through tutorials for specific features can feel like a detour. At Graphed, we remove that friction by letting you create dashboards and get contextual insights using plain English. Instead of building separate worksheets for context, you can simply ask follow-up questions about your data and get the drill-down you need instantly, no configuration required.
Related Articles
How to Connect Facebook to Google Data Studio: The Complete Guide for 2026
Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.
Appsflyer vs Mixpanel: Complete 2026 Comparison Guide
The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.
DashThis vs AgencyAnalytics: The Ultimate Comparison Guide for Marketing Agencies
When it comes to choosing the right marketing reporting platform, agencies often find themselves torn between two industry leaders: DashThis and AgencyAnalytics. Both platforms promise to streamline reporting, save time, and impress clients with stunning visualizations. But which one truly delivers on these promises?