Dashboards & Visualizations

Ordering a bar chart by value, not name

wsw70
Communicator

Hello,

I have a bar chart and it displays as

  |
| |
| | |
a b c

While I would like to have

| 
| |
| | |
b a c

ie. sorted by the value of the bar and not by its name. I searched for "order bar chart", "sort bar chart" but somehow I seem to be the only one having such metaphysical problems 🙂
Any ideas?

Thanks!

Tags (2)
0 Karma
1 Solution

cphair
Builder

Hi wsw,

If you pipe your search to "| sort - Value" (or whatever the field is called), then graph it as a bar chart, it should sort automatically. Does this work for you?

View solution in original post

0 Karma

cphair
Builder

Hi wsw,

If you pipe your search to "| sort - Value" (or whatever the field is called), then graph it as a bar chart, it should sort automatically. Does this work for you?

0 Karma

cphair
Builder

Well, a timechart is always going to show the same order of events on the x-axis because time doesn't change. Are you trying to order the bars within each time segment from largest to smallest?

0 Karma

AlexMcDuffMille
Communicator

It still doesn't seem to work:

(host, sourcetype, yada yada) | multikv fields PRODUCER HOST | timechart span=1d avg(TRANSFERS) as TRANSFERS by HOST | sort - TRANSFERS

0 Karma

cphair
Builder

You need to name the averaged field something. timechart span=1d avg(TRANSFERS) as TRANSFERS by HOST should work.

0 Karma

AlexMcDuffMille
Communicator

I take the average of a field called 'TRANSFERS' so for me my search is "timechart span=1d avg(TRANSFERS) by HOST"

If I add "| sort - TRANSFERS" it doesn't do anything differently.

Any ideas?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...