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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...