Dashboards & Visualizations

Pie chart colors mess up when other field is present

psangli
Explorer

I am using the line

<option name="charting.fieldColors">{"SUCCESS": 0x00FF00, "FAIL":0xFF0000}</option>

with no problems, however when I use

 <option name="charting.fieldColors">{"OK": 0x00FF00}</option>  

in a seperate graph it has problem, because the values that are not "OK" are is grouped into others().
If I put other value from 0.01 to 0 in XML, it fixes it, however I want the other to be there.
How can I have other and have the OK field be green?

Tags (2)
0 Karma

lguinn2
Legend

The charting.fieldColors works great when you know all the names of the fields, but isn't always your best choice when you don't the field names in advance. Try one of these two options:

Option 1: Use seriesColors instead of fieldColors, like this

<option name="charting.seriesColors">[0x00FF00,0x999999,0x1e93c6, 0xf2b827, 0xd6563c, 0x6a5c9e, 0x31a35f, 0xed8440, 0x3863a0, 0xa2cc3e, 0xcc5068, 0x73427f]</option>  

Which should make the first field green, the second field gray, and then the next fields (if any) the standard Splunk colors: blue, yellow, etc.

Option 2: Or you could use fieldColors, but name all the fields

<option name="charting.fieldColors">{"OK": 0x00FF00, "Other": 0x999999}</option>  

To give the Other field a specific color. (You may need to change the capitalization of the field name to match the pie chart output.)

0 Karma

mattymo
Splunk Employee
Splunk Employee

what does the data look like in the search with "others"? can you show post a screenshot of the broken pie?

- MattyMo
0 Karma
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!

Data Persistence in the OpenTelemetry Collector

This blog post is part of an ongoing series on OpenTelemetry. What happens if the OpenTelemetry collector ...

Introducing Splunk 10.0: Smarter, Faster, and More Powerful Than Ever

Now On Demand Whether you're managing complex deployments or looking to future-proof your data ...

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...