Dashboards & Visualizations

Add Color to a Single Value Chart

Hppjet
Path Finder

I am trying to add color to a single value chart. The 1000 is the goal and it changes based on the number of days the search pulls.
Here is my search.

index=Foo ShiftName=1 MachineNumber<26 NumberOfGGRollPaths ElapsedMachineFootageInOrderPath
| eval "Square Yards"= (NumberOfGGRollPaths * ElapsedMachineFootageInOrderPath)*0.66667
| stats dc(_time) as numberofuniquedays sum("Square Yards") as SQYDS
| chart sum(SQYDS)
| eval Scale = (SQYDS/(numberofuniquedays * 1000))
| rangemap field=Scale green=1000-1 yellow=0.8-0.5 red=0.5-0

I can't get the chart to change a color. Please help.

Tags (1)
0 Karma

mdsnmss
SplunkTrust
SplunkTrust

I'm not sure if there is a way to do this within the search itself but you can do it by editing the dashboard panel XML. Here is a link to the single value XML options for reference: http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#single_value

What this might look like is:

     <panel>
      <title>Panel Title</title>
      <single>
        <search>
          <query>index=Foo ShiftName=1 MachineNumber<26 NumberOfGGRollPaths ElapsedMachineFootageInOrderPath
| eval "Square Yards"= (NumberOfGGRollPaths * ElapsedMachineFootageInOrderPath)0.66667 
| stats dc(_time) as numberofuniquedays sum("Square Yards") as SQYDS 
| chart sum(SQYDS)
| eval Scale = (SQYDS/(numberofuniquedays 1000)) 
| rangemap field=Scale green=1000-1 yellow=0.8-0.5 red=0.5-0</query>
        </search>
        <option name="colorBy">value</option>
        <option name="field">Scale</option>
        <option name="useColors">true</option>
        <option name="rangeColors">#00ff00,#ffffe0,#ff0000</option>
        <option name="rangeValues">999,0.8,0.5</option>
      </single>
    </panel>

This might take a little bit of tweaking yet but is the general idea. There are other options available for the Single Value viz documented in those XML docs as well.

0 Karma
Get Updates on the Splunk Community!

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...