Dynamically showing and hiding other controls

Views will collapse when all data is filtered out. However, other controls, such as quick filters, parameters, images, legends, and textboxes, will not collapse and don't have an option to dynamically show or hide. Yet, very often, in a dynamic dashboard, you might want to show or hide these objects. Sometimes parameters don't apply when other selections have been made. Look at the simple example in the previous section. The color legend, which was automatically added to the dashboard by Tableau, applies to the map. But when the bar chart is shown, the legend is no longer applicable.

Fortunately, we can extend the technique we used in the previous section to expand a view to push items we want to show out from under a floating object and then collapse the view to allow the items we want to hide to return to a position under the floating object.

Let's extend the earlier sheet swapping example to show how to show and hide the color legend:

  1. Create a new sheet named Show/Hide Legend. This view is only used to show and hide the color legend.
  2. Create an ad hoc calculation by double-clicking on Rows and type MIN(1). We must have a field on Rows or Columns for the view to collapse, so we'll use this field to give us a single axis for Rows and a single axis for Columns without any other headers.
  3. Duplicate the ad hoc calculation on Columns. You should now have a simple scatterplot with one mark.
  4. As this is a helper sheet and not anything we want the user to see, we don't want it to show any marks or lines. Format the view using Format | Lines to remove Grid Lines from Rows and Columns, along with Axis Rulers. Additionally, hide the axes (right-click each axis or field and uncheck Show Headers). Also, set the Color to full transparency to hide the mark.

  1. We will want this view to show when the Map option is selected, so show the parameter control and ensure it is set to Map, and then add the Show Sheet Filter to filters and check Map:

  1. On the Sheet Swap Dashboard, add the Show/Hide Legend sheet to the Layout Container between the Show Sheet parameter dropdown and the color legend. Hide the title for the Show/Hide Legend sheet.
  2. Ensure that Map is selected. The color legend should be pushed all the way to the bottom.
  3. Add a Layout Container as a floating object. Size and position it to completely cover the area where the color legend used to be. It should cover the title of the Show/Hide Legend sheet but not the parameter dropdown.
Objects and sheets can be added as floating objects by holding Shift while dragging, setting the New Objects option to Floating, or by using the drop-down menu on the object. You may also change the default behavior for new objects from Tiled to Floating in the dashboard pane.
  1. The Layout Container is transparent by default, but we want it to hide what is underneath. Format the Layout Container using the drop-down menu and add white shading so it is indistinguishable from the background.

At this point, you have a dynamic dashboard where the legend is shown when the map is shown and it is applicable and hidden when the bar chart is visible. When Map is selected, the Show/Hide Legend sheet is shown and pushes the legend to the bottom of the Layout Container:

When Bar Chart is selected, the Show/Hide Legend sheet collapses and the legend, which is no longer applicable to the view, falls under/hides behind the Floating Layout Container:

There is no limit to how many variations of this technique you can use on a dashboard. You can have as many layers as you'd like. You can even use combinations of these techniques to push views and objects on and off the dashboard. The possibilities for creating a richly interactive user experience are incredible.

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

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