Dashboards & Visualizations

How to display text message in the center of a dashboard panel?

Chinmai
Explorer

Hi Guys,

I am displaying a custom message in my dashboard panel whenever the search returns nothing. Currently this text message is displaying at the top of the panel, but I want the message to be displayed at the center of the panel.

Can anyone help me with this?

Many Thanks in advance.

0 Karma

rjthibod
Champion

You can use inline CSS on the html element that displays your message.

For example, here is something I do. As long as the token $no_data_chart_msg$ is defined, it will appear in place of the chart, and it is moved down using the margin setting.

<panel>
  <title>...</title>
  <html depends="$no_data_chart_msg$">
    <h3 style="margin: 100px 0 0 10px !important;">$no_data_chart_msg$</h3>
  </html>
  <chart rejects="$no_data_chart_msg$">
      ....
  </chart>
</panel>

If you want to center the message in the horizontal middle of the panel, you will probably have to get creative with the CSS using auto on the margin-left and margin-right settings.

0 Karma

cmerriman
Super Champion

What type of panel is this? Statistics table? HTML? Bar Chart? Single Value?

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...