<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Help on bar chart color in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468658#M30750</link>
    <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;I need to use a different color the 5 series of my bar chart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval cpu_range=case(process_cpu_used_percent&amp;gt;0 AND process_cpu_used_percent &amp;lt;=20,"0-20",
    process_cpu_used_percent&amp;gt;20 AND process_cpu_used_percent &amp;lt;=40,"20-40",
    process_cpu_used_percent&amp;gt;40 AND process_cpu_used_percent &amp;lt;=60,"40-60",
    process_cpu_used_percent&amp;gt;60 AND process_cpu_used_percent &amp;lt;=80,"60-80",
    process_cpu_used_percent&amp;gt;80 AND process_cpu_used_percent &amp;lt;=100,"80-100")
| chart dc(host) as "Number" by cpu_range 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tested many things with rangemap, charting.fieldColors or charting.seriesColors but nothing works!&lt;BR /&gt;
is anybody can explain me what I have to do??&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2019 11:46:59 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2019-12-20T11:46:59Z</dc:date>
    <item>
      <title>Help on bar chart color</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468658#M30750</link>
      <description>&lt;P&gt;hi&lt;/P&gt;

&lt;P&gt;I need to use a different color the 5 series of my bar chart&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval cpu_range=case(process_cpu_used_percent&amp;gt;0 AND process_cpu_used_percent &amp;lt;=20,"0-20",
    process_cpu_used_percent&amp;gt;20 AND process_cpu_used_percent &amp;lt;=40,"20-40",
    process_cpu_used_percent&amp;gt;40 AND process_cpu_used_percent &amp;lt;=60,"40-60",
    process_cpu_used_percent&amp;gt;60 AND process_cpu_used_percent &amp;lt;=80,"60-80",
    process_cpu_used_percent&amp;gt;80 AND process_cpu_used_percent &amp;lt;=100,"80-100")
| chart dc(host) as "Number" by cpu_range 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have tested many things with rangemap, charting.fieldColors or charting.seriesColors but nothing works!&lt;BR /&gt;
is anybody can explain me what I have to do??&lt;BR /&gt;
Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2019 11:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468658#M30750</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-12-20T11:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Help on bar chart color</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468659#M30751</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=2 
| streamstats count 
| eval _time = if (count==2,relative_time(_time,"-1h@m"), relative_time(_time,"@m")) 
| makecontinuous span=1m _time 
| eval host="host".random() 
| eval process_cpu_used_percent=random() % 100 
| eval cpu_range=case(process_cpu_used_percent&amp;gt;0 AND process_cpu_used_percent &amp;lt;=20,"0-20",
    process_cpu_used_percent&amp;gt;20 AND process_cpu_used_percent &amp;lt;=40,"20-40",
    process_cpu_used_percent&amp;gt;40 AND process_cpu_used_percent &amp;lt;=60,"40-60",
    process_cpu_used_percent&amp;gt;60 AND process_cpu_used_percent &amp;lt;=80,"60-80",
    process_cpu_used_percent&amp;gt;80 AND process_cpu_used_percent &amp;lt;=100,"80-100") 
| chart dc(host) as "range" by cpu_range 
| transpose 0 header_field=cpu_range 
| eval column="cpu_range"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try bar chart.&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 00:54:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468659#M30751</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2019-12-21T00:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Help on bar chart color</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468660#M30752</link>
      <description>&lt;P&gt;@jip31 refer to one of my older answers to invert the series using &lt;CODE&gt;transpose&lt;/CODE&gt; command: &lt;A href="https://answers.splunk.com/answers/548161/how-to-change-colour-of-graphs.html"&gt;https://answers.splunk.com/answers/548161/how-to-change-colour-of-graphs.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Following is the query as per your use case. Once you have 5 columns as per CPU ranges defined, you can use &lt;CODE&gt;charting.fieldColors&lt;/CODE&gt; Simple XML Chart configuration option to have the ranges colored as per your needs.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| makeresults count=30 
| fields - _time 
| eval host="host", counter=1 
| accum counter 
| eval counter=printf("%02d",counter),host=host.counter 
| fields - counter 
| eval process_cpu_used_percent=random(), process_cpu_used_percent=substr(process_cpu_used_percent,1,2) 
| eval cpu_range=case(process_cpu_used_percent&amp;gt;0 AND process_cpu_used_percent &amp;lt;=20,"0-20",
    process_cpu_used_percent&amp;gt;20 AND process_cpu_used_percent &amp;lt;=40,"20-40",
    process_cpu_used_percent&amp;gt;40 AND process_cpu_used_percent &amp;lt;=60,"40-60",
    process_cpu_used_percent&amp;gt;60 AND process_cpu_used_percent &amp;lt;=80,"60-80",
    process_cpu_used_percent&amp;gt;80 AND process_cpu_used_percent &amp;lt;=100,"80-100") 
| chart dc(host) as "Number" by cpu_range 
| append 
    [| makeresults 
    | fields - _time 
    | eval cpu_range="0-20,20-40,40-60,60-80,80-100" 
    | makemv cpu_range delim="," 
    | mvexpand cpu_range 
    | eval Number=0] 
| dedup cpu_range 
| sort cpu_range 
| transpose header_field=cpu_range 
| search column!="_*" 
| rename column as cpu_range
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the code for Simple XML Chart configuration which applies Green, Blue, Yellow, Orange and Red colors as per the ranges from 0-20, 20-40, 40-60, 60-80 and 80-100 respectively.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;option name="charting.fieldColors"&amp;gt;{"0-20":0x49B849,"20-40":0x006EAA,"40-60":0xE0AC16,"60-80":0xDA742E,"80-100":0xC84535}&amp;lt;/option&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm!&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 02:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468660#M30752</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-12-21T02:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: Help on bar chart color</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468661#M30753</link>
      <description>&lt;P&gt;perfect thanks&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2019 06:07:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Help-on-bar-chart-color/m-p/468661#M30753</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-12-23T06:07:03Z</dc:date>
    </item>
  </channel>
</rss>

