Splunk Search

How to show values and percentages on hover over columns in 100% stacked column chart?

AlexMcDuffMille
Communicator

Hello,

I have a graph that I'm displaying as a 100% stacked column chart. Even though the Y-Axis is set to 0-100 I still see just the raw/absolute values when I mouse over the colored sections of the columns. Is there a way to make Splunk show the raw/absolute value and the percentage, like it does with the pie chart?

I've been able to get around this in one of my searches by using the "appendcols" command and then taking the percent of one column compared to both added together, but I'm not positive that method will work very well when I have more than 2 series.

Thanks,

Alex

0 Karma

devinbrady
Engager

You can use the foreach command to calculate the percentage for each column iteratively.

In my example, I'm creating a timechart counting different values of my variable view_version, and formatting the results as a percentage in a 100 Percent Stacked column chart.

base_search | timechart count by view_version | addtotals fieldname=_Total | foreach * [eval <<FIELD>> = '<<FIELD>>' * 100 / _Total] | fields - _Total

The fields command removes the _Total field from the final table.

Source: http://answers.splunk.com/answers/169174/percentage-charting-over-time-percentage-of-fieldc.html#ans...

john_q
Explorer

Hi @devinbrady , yes its working as what i need exactly but x axis names are not displaying. example view_version names in your case.

0 Karma

kmcarrol
Path Finder

I'd love to see this answered as well!

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...