Conditionally show or hide panels
Organize your dashboard or conceal empty panels by conditionally showing or hiding panels based on data availability. For example, suppose a chart on your dashboard is empty because it depends on a token setting from a different visualization. In that case, you can hide the chart until the token is set and data is available.
Both Grid and Absolute layout support conditionally showing or hiding panels.
To conditionally hide a panel, follow these steps:
- Select your visualization or input.
- Navigate to the Visibility section of the Configuration panel.
- Select "When data is unavailable, hide element" and a dotted blue line will surround your visualization or input.
The following elements support hiding panels conditionally:
Element | Grid layout | Absolute layout |
---|---|---|
Charts | X | X |
Icons | n/a | X |
Line shape | n/a | n/a |
Rectangles | X | X |
Ellipses | n/a | X |
Dropdown input | X | X |
Multiselect input | X | X |
About the grid layout conditional visibility logic
If you hide a visualization in the grid layout, the dashboard balances the composition of the remaining visualizations by adjusting their sizes. The grid layout prioritizes filling any blank space within the canvas to achieve compositional completeness.
When the grid layout resizes visualizations, it prioritizes adjusting the visualizations neighboring a hidden element. The grid layout works across the dashboard from left to right and top to bottom.
Visualizations with equal proportions
The grid layout maintains the proportion of space used by the viewable visualizations based on shared columns or rows. For example, you might have 4 visualizations in a row, each occupying 25% of the width of the dashboard canvas, and you decide to hide 1 of the visualizations. The remaining 3 visualizations respond to the hidden visualization by adjusting their widths to 33%.
Visualizations with unequal proportions
If you intentionally create a dashboard visualization larger than its fellow visualizations, the larger visualization stays proportionally more prominent than the other visualizations throughout the resizing process. For example, you might have 3 visualizations in a row. 1 visualization takes up 50% of the dashboard, and the other 2 take up 25%. If you hide a small visualization, the larger visualization will adjust to about 65%, and the remaining small visualization will adjust to about 35%.
Example of show or hide in the dashboard definition
You can control the condition of showing or hiding panels with the hideWhenNoData
option in the dashboard definition. The following example shows the hideWhenNoData
set to true, which activates the show or hide feature.
"visualizations": { "viz_Z0robcvp": { "type": "splunk.singlevalue", "dataSources": { "primary": "ds_6j1uZkit" }, "hideWhenNoData": true } },
Embed user and environment details with environment tokens | Scenario: Skyler conditionally shows and hides dashboard panels |
This documentation applies to the following versions of Splunk Cloud Platform™: 9.1.2312, 9.2.2403, 9.2.2406 (latest FedRAMP release), 9.1.2308
Feedback submitted, thanks!