Dashboards & Visualizations

bar chart color

jangid
Builder

Its picking up random color even same day it'll change different color automatically.
How do I fix to green color
.........
.........

bar
none
0
100
Progress (%)
Stage Name



monitor






.........
.........

Tags (1)
0 Karma

jkat54
SplunkTrust
SplunkTrust

http://docs.splunk.com/Documentation/Splunk/5.0.1/Viz/CustomChartingConfig-Overview

(edit 4/14/2016) The link to the charting ref changed a bit in recent versions: http://docs.splunk.com/Documentation/Splunk/6.3.0/Viz/ChartConfigurationReference

How about something like this with bar charts:

    <option name="charting.fieldColors">
{"1. Application":0x00FF00,"2. SOD":0xFF0000}
  </option>

See my answer to your post here to understand 1. Application and 2. SOD.
http://splunk-base.splunk.com/answers/66765/arrange-fields-in-bar-chart-in-specific-order

or this with a gauge chart:

      <option name="charting.chart.rangeValues">[0,100]</option>
  <option name="charting.gaugeColors">[0x006600,0x006600]</option>

Or maybe you need to put this above the charting.seriesColors instead of below it

jangid
Builder

Thanks jkat54 🙂

jonuwz
Influencer

outstanding. Completely unaware of the fieldColors option. I've updated my answer, but this is the real source of information.

jkat54
SplunkTrust
SplunkTrust

I converted your answer to a comment on my answer.

0 Karma

jonuwz
Influencer

Is this on a dashboard with other charts ? There is a master legend for a page, and it tries to make every unique legend item a different colour (This also affects the bar colors)

Add this, so that this chart does not use the master legend, you should have consistent colours.

<param name="charting.legend.masterLegend"></param>

If you want to set it to green you'll also need :

<param name="charting.seriesColors">[0x006600]</param>

Update - All credit to jkat54

Full example, I had to use FlashChart in 4.X since color options are unsupported for JSChart - might be different in 5.x

<?xml version="1.0"?>
<view objectMode="SimpleDashboard" template="dashboard.html">
  <label>Stats Dashboard</label>
  <module name="AccountBar" layoutPanel="appHeader"/>
  <module name="AppBar" layoutPanel="navigationHeader"/>
  <module name="HiddenSearch" layoutPanel="panel_row1_col1" autoRun="True">
    <param name="search">* | timechart span=1d count</param>
    <param name="earliest">-7d@d</param>
    <param name="latest">@d</param>
    <module name="HiddenChartFormatter">
      <param name="chart">bar</param>
      <param name="chart.stackMode">none</param>
      <param name="charting.legend.masterLegend"></param>
      <param name="charting.fieldColors">{"count":0x009900}</param>
      <param name="charting.axisY.minimumNumber">0</param>
      <param name="charting.axisTitleY.text">Progress (%)</param> 
      <param name="charting.axisTitleX.text">Stage Name</param> 
      <module name="FlashChart"/>
    </module>
  </module>
</view>
0 Karma

jangid
Builder

Thanks it works with FlashChart 🙂

0 Karma

jangid
Builder

Unfortunately its not working, still yellow color.
Yes I have three chart in this view.


bar
none
0
100
Progress (%)
Stage Name
[0x006600]


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!

How to find the worst searches in your Splunk environment and how to fix them

Everyone knows Splunk is a powerful platform for running searches and doing data analytics. Your ...

Share Your Feedback: On Admin Config Service (ACS)!

Help Us Build a Better Admin Config Service Experience (ACS)   We Want Your Feedback on Admin Config Service ...

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...