Dashboards & Visualizations

How do you color a pie chart that has variable results on its field?

abdullahalhabba
Explorer

Hi Splunker,

I need to control for the color on a pie chart, I used the following query:

{"critical": 0xFF0000, "high": 0xFF9900, "medium":0x0066FF, "low":0xC4C4C0, "informational":0x00FF01}

But this query doesn't work because I have variable results on severity field, you can see the screen shot.

I have used the following search:

my search| top threat:severity | rename threat:severity as threat_severity | eval signature_slice = "Count: " + count + ", " + threat_severity | fields signature_slice count 

Please I need your support.alt text

0 Karma

mayurr98
Super Champion

Hi I think you can control colors but then you can not show count on the pie chart instead you can show percentage.

then change your query to :

my search| top showperc=f threat:severity | rename threat:severity as threat_severity

And in XML use

<option name="charting.fieldColors">
  {"critical": 0xFF0000, "high": 0xFF9900, "medium":0x0066FF, "low":0xC4C4C0, "informational":0x00FF01}
</option>
<option name="charting.chart.showPercent">true</option>

lets see if anybody has better solution for you.
let me know if this helps!

0 Karma

abdullahalhabba
Explorer

Hi, Thank you My friend,

Yes I know that about I can
show percentage.

But I need show count with control for color.

0 Karma

mayurr98
Super Champion

Well as far as I know this is not possible using XML conf.

0 Karma

abdullahalhabba
Explorer

Ok, is I can do that by use the search.

Thank you

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