Filters

Learn how to add filter elements that let your users refine data used in charts, maps, and tables.

Overview

Filter elements let your users control which records (rows) from a dataset are displayed in visual elements like charts, maps, and tables. They introduce dynamic interactivity to your visualization, supporting a wide range of use cases, such as filtering by categories, dates, or numerical ranges.

Filter elements are highly flexible:

  • They can be displayed as checkboxes, dropdown menus, or sliders.
  • A single filter element can connect to multiple visual elements, and multiple filters can be connected to the same element.
  • Filters can connect to elements that use different datasets by matching field names across datasets.
  • Filters can be connected to other filters to create a hierarchical filtering system.

You can add a Filter element to your visualization by selecting Insert in the Toolbar and dragging a Filter onto the canvas. Alternatively, click the Filter icon that appears when hovering on an empty Section.

Filters can be configured by selecting an existing filter element and using the options available in the Filter tab in the right panel. These options are detailed below.

Tip

If you need to control the visibility of data series in wide-format datasets, use Selector elements instead of filters. Selectors manage which dataset fields (columns) are shown, while filters control which dataset records (rows) are shown.

Setup

In the Setup section, under the Filter tab, you can configure the following options:

  • Name: Enter the filter's name to identify it in the Layers tab and on the canvas.
  • Display Style: Select how the filter appears by choosing "Checkbox", "Dropdown", or "Slider."
  • Margin: Specify the space around the filter element in pixels.
  • Alignment: Align the filter element to the left, center, or right within its container.

Connecting to Datasets

In the Dataset section, you can select the dataset that provides the values for your filter. If you need to add a dataset, this can be done by selecting New Dataset in the Project tab.

Pro

If you are on the Pro plan, you can upload your own files (in csv format) to use as datasets, by clicking New Dataset and then Upload Dataset.

After selecting a dataset, choose the Filter Field—the column that contains the values users can filter by. The available values in this field will populate your filter element.

You can optionally enable the Prefilter Dataset switch, which lets you filter the data that is supplied to the filter element itself. This is useful when you want to limit which filter options are available to users.

Establishing Connections

In the Connections section, you can connect your filter to charts, maps, tables, and other elements in your visualization.

Select Target Elements to choose which visual elements should be affected by this filter. When users make selections in the filter, only the connected elements will update to show the filtered data.

You can connect a single filter to multiple elements, and each element can be connected to multiple filters. The filter will affect any connected element that has a field (column) with the same name as the Filter Field.

Checkbox Settings

When Display Style is set to "Checkbox", the following options are available:

  • Layout: Choose between "Vertical" (stacked) or "Horizontal" (side-by-side) arrangement of checkboxes.
  • Columns: When using horizontal layout, specify how many columns to display the checkboxes in.
  • Show Select All: Add a "Select All" option that allows users to quickly select or deselect all available options.
  • Default Selection: Choose which options should be selected by default when the visualization first loads.

When Display Style is set to "Dropdown", the following options are available:

  • Placeholder Text: Set the text that appears when no option is selected.
  • Allow Multiple Selection: Enable users to select multiple options from the dropdown.
  • Default Selection: Choose which option should be selected by default when the visualization first loads.
  • Search: Enable search functionality within the dropdown for easier navigation of long lists.

Slider Settings

When Display Style is set to "Slider", the following options are available:

  • Range Type: Choose between "Single Value" (one handle) or "Range" (two handles for min/max selection).
  • Step Size: Define the increment between values on the slider.
  • Display Format: Choose how values are displayed (number, currency, percentage, etc.).
  • Default Value: Set the initial position of the slider handle(s).

The slider option is only available when the Filter Field contains numeric data.

Color Formatting

Filter elements can inherit colors from connected charts and maps, creating a cohesive visual experience. Color inheritance works as follows:

  • Colors are inherited in the order specified under Target Elements in the Connections section. Earlier connections take precedence over later ones when assigning colors.
  • Colors can only be assigned by charts and maps that use Long Data format. If you wish to dynamically control the color field on a chart or map that uses Wide Data format, use a Selector element.
  • If a connected chart or map uses the same dataset as the filter and the Color Field matches the filter's Filter Field, the colors assigned in the chart or map are applied to the filter's checkboxes or dropdown items.
  • If a connected chart or map uses a different dataset but has a Color Field with the same name as the filter's Filter Field, the filter will attempt to apply colors from the chart or map. Colors are assigned only for values that match between the two datasets. If there are additional values in the connected chart or map's Color Field, they will not be displayed in the filter.
Tip

To use the same filter element to control multiple elements with different datasets—especially when the values in their respective Color Fields don't align perfectly—consider creating a separate dataset containing a field with all values you wish to assign colors to. Then, configure the filter element to use this dataset and select the comprehensive field as the Filter Field. This approach ensures the filter lists all possible values while still applying colors from the connected charts and maps.

Advanced Logic

Filter elements can be adapted for several use cases in the Advanced Logic section:

  • Select Apply to Annotations if you are connecting the filter to a line or area chart which contains annotations. When enabled, the filter will control the visibility of these annotations, assuming the Filter Field matches the field used for the chart's independent axis.
  • Fallback Behavior: When no filter items are selected by the user, or (in the case of a dropdown) the placeholder text is selected, this option defines whether all values ("Select All") or no values ("Select None") should be displayed in connected elements.
  • Show Null Values: When enabled, the filter element will never filter out empty values in the filter field.
Tip

To keep certain records visible in charts, maps, or tables without listing them in a filter element, leave the Filter Field blank for those records and enable Show Null Values. For example, if you want a baseline variable to always appear while letting the user switch between comparison variables, create a Filter Field that is empty for baseline records and contains values for comparison variables; then set this as the Filter Field and turn on Show Null Values.