Handling no data and data errors
1. Overview
At viewing time, if no data is returned for a visualization or if a data error occurs, you'll see a corresponding message displayed by the visualization instead of a blank area. For each data visualization, you can add an interaction when a No Data event or a Data Error event occurs. This allows you to show/hide layers of content or execute some custom script when these events occur.
2. No data indicator
As an example, consider the following dashboard consisting of a chart and a calendar range filter.
In View mode, set the calendar range of the filter to a value for which there is no data (e.g., 2004 to 2004).
Instead of showing a blank chart, you see a no data was returned indicator.
3. Data-related events
There are three data-related events that can occur for data visualizations. For each of these events you can add an action to run such as Change Layer or your own script. For example, if No Data occurs for a chart, you may want to hide the chart and associated labels completely.
You can find these in the Properties window of any data visualization in the Actions section:
- Data Change - Occurs when the data visualization's data changes in any way after initially loading. This will always fire before No Data and Data Error.
- No Data - Occurs when the control doesn't receive any data back.
- Data Error - Occurs when the control's data changes, and the data has an error and cannot be shown.
To choose an action to add, click the + or menu icon to the right.
Setting up interactions is described in more detail in the article Using interactions.