Dashboards & Visualizations

Change background color of a single value panel based on value

mdmaala
Communicator

hi! I have several single value panels and I want for each panel's background color to change based on its value. the values are different for various panels. is there a way to do this using search, simple XML or custom CSS?

I've tried applying some suggestions I saw from previously asked questions regarding this topic, but those does not seem to work for my usecase. Or maybe I just overlooked something?

thank you so much.

0 Karma

paramagurukarth
Builder

Is this what you want
alt text
or you value is some string and not int

0 Karma

mdmaala
Communicator

I did that already, but what I am tying to do, is creating a conditional search then depending on the result, the background color of the single value panel changes.

0 Karma

mdmaala
Communicator

but thank you so much for all the help!

0 Karma

niketn
Legend

@mdmaala If you use colorMode as block this should be possible out of the box directly from the UI as per the screenshot shared by @paramagurukarthikeyan . You need to choose the second radio for Color Mode.

No CSS or JS required. Unless you have a complicated requirement for which you need to provide more details, for us to assist you better.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

mdmaala
Communicator

hi! sorry for the late reply. for now I just used this, but what I really wanted is by creating a conditional search then based on the result the background color of the single value panel changes.

0 Karma

FrankVl
Ultra Champion

Which suggestions did you try so far? As far as I know you can simply do this by going into edit mode on the dashboard, open up the format settings for that particular single value panel and set the color settings (you can choose whether to color the value or the background).

0 Karma

mdmaala
Communicator

i tried using customization using css and simple xml. but this does not seem to work for me. But is there a way that I can do this using search, that instead of manually setting it using the format visualization option, it will automatically change when a certain condition is met or not?

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 ...