Creating a highlight action

The highlight action in Tableau dashboards allows related marks in other views to be emphasized by retaining their colors and dimming the colors of all other unrelated marks.

In this recipe, we will use a highlight action on mouse hover to highlight the points history and players for a specific NBA team.

Creating a highlight action

Getting ready

To follow this recipe, open B05527_04 – STARTER.twbx. We will use the following worksheets:

  • Teams
  • Players
  • Points History
    Getting ready

How to do it...

The following are the steps to create the dashboard in this recipe:

  1. At the bottom of your Tableau design area are three tabs with plus signs, which allow you to create a new sheet, dashboard, and story point respectively. Click on the middle icon with a grid to create a new dashboard.
    How to do it...
  2. When in the dashboard design area, the sidebar becomes a Dashboard bar, showing the available worksheets and other dashboard components.
  3. Change the dashboard name to Team and Players – Highlight.
  4. Check the Show dashboard title checkbox located at the bottom of the sidebar. This will show the dashboard title text box in the dashboard.
    How to do it...
  5. Change the dashboard title to show the following:
    How to do it...
  6. Right-click on the dashboard title, and select Format Title. Choose a light gray background to the title.
  7. If needed, adjust the height of the dashboard title so the whole text is visible.
  8. Under the Objects section, ensure that Tiled is selected and not Floating.
  9. Click on the Dashboard menu, and choose Format.
    How to do it...
  10. Under Dashboard Shading, change the color beside Default to a light color. This will set the dashboard background color.
    How to do it...
  11. Drag the worksheets from the Dashboard tab, under the Sheets section, onto the dashboard.
    • Drag the Teams worksheet. By default, when Tiled is selected, this first sheet and its components will occupy the whole dashboard space.
    • Drag the Players worksheet to the right of Teams. When you drag it, you will notice certain areas will get shaded. Release your mouse only when the shaded area is to the right of the Teams worksheet.
    • Drag the Points History worksheet and place it below Teams, and to the left of Players.
    How to do it...
  12. Click the drop-down arrow on the color legend, and choose Select Layout Container. This selects the container that the legend belongs to, and is identified by a dark blue border.
    How to do it...
  13. Click on the X on the top-right corner of the container border to remove the layout container.
    How to do it...
  14. Click on Delete when you receive a warning about removing the layout container.
    How to do it...
  15. Click on the Dashboard menu and select Actions.
    How to do it...
  16. In the Actions window, click on Add Action, and choose Highlight.
    How to do it...
  17. In the Add Highlight Action window:
    • Change the Name to Highlight Team
    • Change the Run action on: to Hover
    • Leave everything else as the default, and select OK to close the window
    How to do it...
  18. Test the dashboard. Use the presentation mode (or press F7) to see what the end users will see. Confirm that when you hover over any of the teams in the bar chart, you see the corresponding points history for that team highlighted in the time series graph, as well as the players on that team highlighted in the scatter plot.

How it works...

The Highlight action emphasizes the selected values, and blurs everything else to the background.

Before I continue, I would like to apologize for the many colors in the sheets! Yes, yes I can hear you say Skittles in the background. As a rule of thumb in visual analytics, we do not want to use color as a way to differentiate different dimensions where there are more than a handful of values. However, in this recipe, I wanted to make it clear what the highlight action does. Once set up, when you hover over a team, all other team marks in other worksheets are highlighted. This is more obvious with the consistency of colors in the three worksheets.

In this recipe, we used a highlight action on mouse hover for our three worksheets. The three worksheets all use Team field. When we created the Highlight action using All Fields, all fields that are common to the three worksheets are matched up. Therefore, when a team is highlighted on any of the sheets, the other two sheets' corresponding team marks are highlighted. All other teams' marks are dimmed.

The highlight action can be triggered on Select, Hover, or Menu. Select requires that the mark or label be clicked. The Hover action activates when the mouse pointer is over a mark or label—these don't have to be clicked. Menu creates a hyperlink for each action that uses Menu, and these will show when a mark or label is clicked.

There's more...

We have to be careful to use highlighting on sheets that have common fields. If we target a sheet that does not use the field used in the highlight, then we will see that graph grayed out altogether, as seen in the following screenshot:

There's more...

Since the whole chart gets grayed out, almost looking like the whole view is disabled, a mismatch in the highlighted fields may create the impression that the dashboard is broken. It is best to not target worksheets that do not have common columns to avoid this effect.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.17.140