Dashboards & Visualizations

How can i restrict colors for PIE visualization !!

rakesh_498115
Motivator

Hi

i am using three pie chart visualzations in my dashboard.Now in these pie visualzations i am getting random colors for each of the visualzations.How can restrict these colors to be unique for the entire dashboard i.e in all the three pie visualzations i need the color which i am interested..

Thanx

Tags (2)
1 Solution

Gilberto_Castil
Splunk Employee
Splunk Employee

There is a specific way to add charting colours and it depends on the way your chart is configured.

With the simple XML you will use something like this:

<chart>

<searchName> my search </searchName>

<option name="charting.chart">pie</option>

<option name="charting.seriesColors">[0x263E7B,0x9EB1DE,0x65718E]</option>

</chart>

With the advanced XML, you can use something like this:

<module name="HiddenChartFormatter">

<param name="chart">pie</param>

<param name="charting.seriesColors">[0x263E7B,0x9EB1DE,0x65718E,0xAFBDDE]</param>
<module name="FlashChart">

The documentation is here.

View solution in original post

Gilberto_Castil
Splunk Employee
Splunk Employee

There is a specific way to add charting colours and it depends on the way your chart is configured.

With the simple XML you will use something like this:

<chart>

<searchName> my search </searchName>

<option name="charting.chart">pie</option>

<option name="charting.seriesColors">[0x263E7B,0x9EB1DE,0x65718E]</option>

</chart>

With the advanced XML, you can use something like this:

<module name="HiddenChartFormatter">

<param name="chart">pie</param>

<param name="charting.seriesColors">[0x263E7B,0x9EB1DE,0x65718E,0xAFBDDE]</param>
<module name="FlashChart">

The documentation is here.

Gilberto_Castil
Splunk Employee
Splunk Employee

If you look at the results in tabular format, you will have three rows:

accepted count percent
rejected count percent
exception count percent

Or something like that...

As far as I understand, the charting porition will assign the colour based on the row assignment such that:

accepted count percent -> 0x263E7B
rejected count percent -> 0x9EB1DE
exception count percent -> 0x65718E

I have not tested that but my spidey sense tells me so... :).

BTW: You can extropolate a colour scheme at http://colorschemedesigner.com/. And if you can, please donate to keep them online.

0 Karma

rakesh_498115
Motivator

Tats cool..Ok..can i restrict these colors for specfic values .

i.e assume i am using three colors as you mentioned above
0x263E7B,0x9EB1DE,0x65718E and i have three values for my pie chart Accepted,Rejected and Exception.

Always Accepted count should be given 0x263E7B color and Rejected with 0x9EB1DE color and Exception with 0x65718E color for all the three pie charts in my dashboard...

How can i acheive this ??

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!

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, ...