Dashboards & Visualizations

Change radialGauge colors

JovanMilosevic
Path Finder

Hi,

I'd like to change the color sequence of the new gauge in v4.2. Instead of Green, Yellow, Red, I would like to reverse the sequence. I've looked at the manual on palettes, but I'm going around in circles, and my brain hurts.

Thanks.

1 Solution

jflomenberg
Splunk Employee
Splunk Employee

In basic xml there are 3 main things that users may want to do with gauges - the most common of which is changing the colors (since there really isn't anywhere else to do this). You can also set the gauge type and set the ranges, and set the colors. Note that if you set the ranges in xml they will always OVERRIDE whatever may be in the search language. Here's an example

 <param name="charting.chart.style">shiny</param>
 <option name="charting.chart.rangeValues">[0,30,70,100]</option>
 <option name="charting.gaugeColors">[0x84E900,0xFFE800,0xBF3030]</option>

To do things like change the axis orientation for the linear and market gauges, as well as to change the gauge to display in percentages you'll need to use advanced xml.

View solution in original post

jflomenberg
Splunk Employee
Splunk Employee

In basic xml there are 3 main things that users may want to do with gauges - the most common of which is changing the colors (since there really isn't anywhere else to do this). You can also set the gauge type and set the ranges, and set the colors. Note that if you set the ranges in xml they will always OVERRIDE whatever may be in the search language. Here's an example

 <param name="charting.chart.style">shiny</param>
 <option name="charting.chart.rangeValues">[0,30,70,100]</option>
 <option name="charting.gaugeColors">[0x84E900,0xFFE800,0xBF3030]</option>

To do things like change the axis orientation for the linear and market gauges, as well as to change the gauge to display in percentages you'll need to use advanced xml.

JovanMilosevic
Path Finder

Thanks for your help - there is a slight error, but you got me close enough. Should have been

[0,30,70,100]

0 Karma

jgatt
Splunk Employee
Splunk Employee

It's possible to do with palettes, but that's the hard way, and unnecessary for simply changing colors. Apparently the easy way hasn't made it to the docs yet.

Default palettes are already set up and wired to simpler properties to make things like this especially easy. There is a property, similar to the seriesColors property for charts, called gaugeColors that takes a list of hexadecimal color values. The following is the reverse of the default colors:

<param name="charting.gaugeColors">[0xBF3030,0xFFE800,0x84E900]</param>

You can specify any number of colors. If your gauge has more or less range intervals than the number of colors you specify, the colors will be interpolated as needed.

Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...