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.

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...