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!

Splunk Observability Cloud | Unified Identity - Now Available for Existing Splunk ...

Raise your hand if you’ve already forgotten your username or password when logging into an account. (We can’t ...

Index This | How many sides does a circle have?

February 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Registration for Splunk University is Now Open!

Are you ready for an adventure in learning?   Brace yourselves because Splunk University is back, and it's ...