Dashboards & Visualizations

Charting fields code for the dashboard

AL3Z
Builder

Hi,

How we can apply the color for the respective fields in this dashboard.
source code :
<title>Top Web Category blocked</title>
<search>
<query>index=es_web action=blocked host= * sourcetype= *
| stats count by category
| sort 5 -count</query>
<earliest>$time_range_token.earliest$</earliest>
<latest>$time_range_token.latest$</latest>
</search>
<option name="charting.axisTitleX.visibility">visible</option>
<option name="charting.axisTitleY.visibility">visible</option>
<option name="charting.axisTitleY2.visibility">visible</option>
<option name="charting.chart">bar</option>
<option name="charting.backgroundColor">#00FFFF</option>
<option name="charting.fontColor">#000000</option>
<option name="charting.foregroundColor">#000000</option>
<option name="charting.chart.stackMode">default</option>
<option name="charting.drilldown">none</option>
<option name="charting.fieldColors">{"online-storage-and-backup":0x333333,"unknown":0xd93f3c,"streaming-media":0xf58f39,"internet-communications-and-telephony":0xf7bc38,"insufficient-content":0xeeeeee}</option>
<option name="charting.legend.placement">right</option>
<option name="refresh.display">progressbar</option>
</chart>
</panel>
</row>
</form>


output:

AL3Z_0-1698301208133.png


need a different  colors for all the fields, how we can achieve this 
thanks

Labels (2)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

In order to be able to colour them differently, you need separate fields. Try adding this to the end of your search

| transpose 0 header_field=category
0 Karma

AL3Z
Builder

Thanks, Can you be more precise where do we need to paste this in the xml source code of dashboard.

Thanks

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

At the end of the search query, i.e. after the sort command

AL3Z
Builder

Hi @ITWhisperer ,

How to make the fields to get displayed instead of row1,row2.....

AL3Z_2-1698334474804.png

Thanks..

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!

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...

Upgrade Prep for 10.4, Network Observability Deep Dives, and More from Splunk Lantern

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...

Splunk Developer Day announcements: AI agents, MCP tools, Forecasting, and Custom ...

Splunk Developer Day was packed with product and platform updates for developers building in the AI ...