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!

Shape the Future of Splunk: Join the Product Research Lab!

Join the Splunk Product Research Lab and connect with us in the Slack channel #product-research-lab to get ...

Auto-Injector for Everything Else: Making OpenTelemetry Truly Universal

You might have seen Splunk’s recent announcement about donating the OpenTelemetry Injector to the ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...