Dashboards & Visualizations

bar chart color

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

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

Builder

Thanks jkat54 🙂

Influencer

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

SplunkTrust
SplunkTrust

I converted your answer to a comment on my answer.

0 Karma

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

Builder

Thanks it works with FlashChart 🙂

0 Karma

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