Dashboards & Visualizations

How to change bar chart colors for single count

soulmaker
Explorer

Hi, I wanted to have a bar graph that has different colour for better represention of my dashboard. I do have a search like below"

 

type="request" "request.path"="prod" | stats count by account_namespace | sort - count | head 10

 

I tried adding the "<option name="charting.seriesColors">[0x1e93c6, 0xf2b827, 0xd6563c, 0x6a5c9e, 0x31a35f, 0xed8440, 0x3863a0, 0xa2cc3e, 0xcc5068, 0x73427f]</option>" but I still get a single colour in my bar graph. I believe since i only one series for my query hence the single colour output. 

Is there a way for me to have my bar graph contains multiple colour?

Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

You can do either of these first to turn it to a multiseries chart

| eval namespace=""
| xyseries namespace account_namespace count

OR

| transpose 0 header_field=account_namespace column_name=account_namespace
| eval account_namespace=""

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

You can do either of these first to turn it to a multiseries chart

| eval namespace=""
| xyseries namespace account_namespace count

OR

| transpose 0 header_field=account_namespace column_name=account_namespace
| eval account_namespace=""

soulmaker
Explorer

Thanks @bowesmana for your reply and sharing the below. I have now managed to make it multiseries chart by applying you've shared below. However, it is showing the result of all of the account_namespace, is there a way for me to filter the highest 10 count and only shows that?

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Your original search will already limit the top 10, as you are doing sort+head, so not sure I understand how you are getting all results?

0 Karma

soulmaker
Explorer

Yeah, I am a bit confuse as well. Seems like the last part of the query "| sort - count | head 10" does not really do anything. 

So I've modified my search to be like:

type="request" "request.path"="prod/" | stats count by account_namespace | eval namespace="" | xyseries namespace account_namespace count | sort - count | head 10

by using the above, it gives me a result where the account_namespace shows as a column with all the count as the value. In the column it is showing all of it and not only the top 10 that has highest count. 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Put my additional SPL - AFTER your original search - you've added it in the middle

soulmaker
Explorer

This works! thanks man for your help on this one. 

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...