A List Box control is an interactive on-page control where the user will see the list of filter options they can apply. The trade-off with using list boxes is they take up more space on your Page since the choice list is shown.
This article describes how to create a List Box control to filter outputs on your page. The article contains the steps to take you from a Page containing a visualization (Small Multiples Bar)...
...to a Page containing List Box Filters on an Output that can be used to filter the visualization.
Requirements
- An item to filter on a Page (e.g., table, chart, visualization, etc.).
- Variable sets to use as filters (structured as Nominal, Ordinal, or Binary-Multi)
Please note this requires the Data Stories module or a Displayr license.
Method
- Select the output(s) you wish to filter with a List Box.
- Go to the Anything icon and select Filter > Control > List Box Filters on an Output.
- Select the variable sets you wish to use as filters and select OK. To make creating the filters easier, select all the variable sets you want to create List Box filters for at once.
List Box menu(s) will appear on the Page. One List Box menu per filter. Displayr will create a new List Box Filter variable in the Data Sources tree linked to the List Box selections. Displayr will also automatically apply the filter variable to all the outputs selected in Step 1.
The options displayed in the List Box are static. If your question changes and options are removed or added (e.g., add Prefer not to say to Gender), you'll have to manually update the object inspector > Control > Item list to match those changes.
Other Considerations
- This filtering is specific to this page and list box only. If you want to show and apply the same list box controls on multiple pages:
- You can apply the filter to outputs on other pages, but those filters will be based on this List box on this page. This is useful if you want a page of filters that will be used to apply to the whole document.
- You can show the same list box with the same selections across multiple pages. See How to Use the Same Control on Multiple Pages.
- Any item selected in the list boxes when you Publish a Document will be the default item selected in View Mode.
Next
How to Use the Same Control on Multiple Pages
How to Create a Combo Box (Drop-Down Control) With a Dynamic List
How to Dynamically Change a Question Based on a Control Box
How to Select Which Rows or Columns to Show in a Visualization Based on a Control Box Selection
How to Switch Logos and Images Based on a Control Box Selection