Dashboards & Visualizations

Set a Default Color in Single Value Panel if Trendline is not displayed

marxsabandana
Path Finder

I want to disable the varying red-green color indication by trend, and set it into a static color (green) if the trendline is not displaying at all in the panel. This happens when the timespan is less than the date range. For the example below, I only set it to three months, but when I set the date range into 2 years+, the sparkline will appear in the Sales (Yearly) panel.

The timespan of the single value chart has 1 year.

The query is:
| timechart span=1year sum(amount) as Sales

(the other panels have a span of 1 day, 1 week, and 1 month)

alt text
The Sales(Yearly) has no sparkline so I think it must have no red or green color indication. Is there a possible way to detect the appearance of the sparkline to trigger a token that will change the color of the panel?

alt text

0 Karma

niketn
Legend

@marxsabandana for the final Single Value panel you can disable the color directly from UI Edit, or through SimpleXML

<option name="useColors">0</option>

Is this what you are looking for?

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

marxsabandana
Path Finder

Sorry, but actually what I really meant is to disable the varying red-green color indicators. Like, if a sparkline is not displayed below the single-value, the panel will be defaulted to color green.

0 Karma

harshpatel
Contributor

Hi @marxsabandana Trendline won't show when the result has only 1 row. So you can maybe check result count on search:done event and set chart options accordingly?

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