Dashboards & Visualizations

Will you help me show percentage in 100% stacked bar chart?

john_q
Explorer

i have two fields such as "request_time" and "app_error".

I need to show the count and percentage as well. This is working fine when I am using pie chart. But i want to use a 100% stacked bar chart. So, whenever i mouse over to the bar, it has to show count and percentage like if count is "request_time 62 percentage 68.2%" and "app_error 44 percentage 32%" like pie chart.

0 Karma

mayurr98
Super Champion

hey, have you looked at @niketnilay's answer?
https://answers.splunk.com/answers/598632/add-percent-sign-on-a-stacked-column-chart-data-la.html

let me know if this helps!

0 Karma

john_q
Explorer

Hi @mayurr98 , thanks for the reference but i don't want to use the script. i am looking for a query which shows percentage. for example request_time count is 622 and app_error count is 350 then when i mouse over on the bar display request_time 62.2% and app_count is remaining % out of 100%.

0 Karma

mayurr98
Super Champion

I do not think its possible through query or XML as pie chart has that option already but you will have to use a script to add "%" sign for the stacked bar chart.
let's see if anyone has a better idea for this or if it is solvable through query.

0 Karma

john_q
Explorer

its working fine but x axis field names are not displaying like by cause.

stats count(type) as names sum(bytes) as Bytes by browsers | addtotals fieldname=_Total | foreach * [eval <> = '<>' * 100 / _Total] | fields - _Total

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...