<?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 How to color the bar chart of a field based on other field value? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551072#M38078</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Need help in coloring the bar chart of a field based on the other field value? Below is my sample search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=nextgen sourcetype=lighthouse_json datasource=LH step="http://www.google.com/" 
| stats  values(speedindex) as speedindex by _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample log for the above search&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SG_0-1620644952639.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14102i070004B62CF280C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SG_0-1620644952639.png" alt="SG_0-1620644952639.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and visualization for the above query...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SG_1-1620645018728.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14103iB427652301417F34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SG_1-1620645018728.png" alt="SG_1-1620645018728.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I wanted to color the bars of the speed index based on the score? For example in the above screenshot&amp;nbsp;&lt;SPAN&gt;speedindex_score is 89, which means the page is performing good and I wanted to get that bar in green color.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;speedindex_score is in between 0-49 - Red color&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;speedindex_score is in between 50-89 - yellow color&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;speedindex_score is in between 90-100 - Green color&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone please help me with how to plot in the above mentioned manner?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 10 May 2021 11:18:14 GMT</pubDate>
    <dc:creator>SG</dc:creator>
    <dc:date>2021-05-10T11:18:14Z</dc:date>
    <item>
      <title>How to color the bar chart of a field based on other field value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551072#M38078</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Need help in coloring the bar chart of a field based on the other field value? Below is my sample search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=nextgen sourcetype=lighthouse_json datasource=LH step="http://www.google.com/" 
| stats  values(speedindex) as speedindex by _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sample log for the above search&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SG_0-1620644952639.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14102i070004B62CF280C0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SG_0-1620644952639.png" alt="SG_0-1620644952639.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;and visualization for the above query...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SG_1-1620645018728.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14103iB427652301417F34/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SG_1-1620645018728.png" alt="SG_1-1620645018728.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I wanted to color the bars of the speed index based on the score? For example in the above screenshot&amp;nbsp;&lt;SPAN&gt;speedindex_score is 89, which means the page is performing good and I wanted to get that bar in green color.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;speedindex_score is in between 0-49 - Red color&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;speedindex_score is in between 50-89 - yellow color&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;speedindex_score is in between 90-100 - Green color&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can someone please help me with how to plot in the above mentioned manner?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 11:18:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551072#M38078</guid>
      <dc:creator>SG</dc:creator>
      <dc:date>2021-05-10T11:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the bar chart of a field based on other field value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551074#M38079</link>
      <description>&lt;P&gt;Charts are coloured by series, e.g. all bars in the same series are the same colour, therefore, to get different colours, you need to split your data into different series.&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 11:29:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551074#M38079</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-10T11:29:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the bar chart of a field based on other field value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551078#M38080</link>
      <description>&lt;P&gt;Hi, I changed the query to get data into 2 different series&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=nextgen sourcetype=lighthouse_json datasource=LH step="http://www.google.com/" 
| stats  values(speedindex) as speedindex, values(speedindex_score) as score by _time&lt;/LI-CODE&gt;&lt;P&gt;Below is the sample data&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SG_0-1620646873055.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14104iEC9D1525612199ED/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SG_0-1620646873055.png" alt="SG_0-1620646873055.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Now I devided data into 2 different series, can you please help me with how to color the bar chart of&amp;nbsp;speedindex based on score value?&lt;/P&gt;</description>
      <pubDate>Mon, 10 May 2021 11:42:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551078#M38080</guid>
      <dc:creator>SG</dc:creator>
      <dc:date>2021-05-10T11:42:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the bar chart of a field based on other field value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551084#M38081</link>
      <description>&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SplunkCloud/8.2.2104/Viz/BuildandeditdashboardswithSimplifiedXML#Specify_custom_colors_for_fields_in_charts" target="_blank"&gt;https://docs.splunk.com/Documentation/SplunkCloud/8.2.2104/Viz/BuildandeditdashboardswithSimplifiedXML#Specify_custom_colors_for_fields_in_charts&lt;/A&gt;&lt;/P&gt;&lt;P&gt;However, your search doesn't split the values of the field into different series by range. You should evaluate copies of the values into new fields based on the value of the original field falling into the ranges you want.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval low=if(speedindex_score&amp;lt;50,speedindex_score,null)
| eval medium=if(speedindex_score&amp;gt;=50 AND speedindex_score &amp;lt;90,speedindex_score,null)
| eval high=if(speedindex_score&amp;gt;=90,speedindex_score,null)&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 10 May 2021 12:08:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551084#M38081</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-05-10T12:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to color the bar chart of a field based on other field value?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551786#M38153</link>
      <description>&lt;P&gt;With the below, I am able to color the bar charts based on the score field value. For the colors I edited XML.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=nextgen sourcetype=lighthouse_json datasource=LH step="https://www.google.com/"
| stats values(speedindex) as speedindex, values(speedindex_score) as score by _time

| eval green = if(score&amp;gt;=90 AND score&amp;lt;=100,speedindex,0)
| eval yellow = if(score&amp;lt;=89 AND score&amp;gt;50,speedindex,0)
| eval red = if(score&amp;lt;=49 AND score&amp;gt;0,speedindex,0)
| fields - speedindex,score&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 May 2021 06:18:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-color-the-bar-chart-of-a-field-based-on-other-field-value/m-p/551786#M38153</guid>
      <dc:creator>SG</dc:creator>
      <dc:date>2021-05-17T06:18:58Z</dc:date>
    </item>
  </channel>
</rss>

