<?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 Re: Change Color of Column in Column Chart Based on Field Value in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/510247#M34019</link>
    <description>&lt;P&gt;This last reply worked perfectly. I was able to create chart with the normal theme and with the dark theme. My users will have a choice as to how they want to see the data.&lt;/P&gt;&lt;P&gt;Thank you!!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 15:23:06 GMT</pubDate>
    <dc:creator>srewarrior</dc:creator>
    <dc:date>2020-07-21T15:23:06Z</dc:date>
    <item>
      <title>Change Color of Column in Column Chart Based on Field Value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509586#M33950</link>
      <description>&lt;P&gt;I know someone is going to say this has been answered many times but...I have gone through every example I can find here in the Community and have yet to find something that will work. I have a monitor that runs every 5 minutes to validate a web URL is alive and it records the number of milliseconds for the total response time. My query returns two values _time and total_time for each 5 minute ping. I can use the "pencil" on the right to add color and ranges to the table display but it does not flow into visualization. My search:&lt;/P&gt;&lt;P data-unlink="true"&gt;index=xxx_website_monitoring sourcetype=web_ping https://my.website.com&amp;nbsp;| stats values(total_time) by _time&lt;/P&gt;&lt;P&gt;The column chart works but I need to make each column Green, Yellow or Red based on the value of total_time like:&amp;nbsp;&lt;/P&gt;&lt;P&gt;| eval red = if(total_time&amp;gt;=500,total_time,0)&lt;/P&gt;&lt;P&gt;| eval yellow = if(total_time&amp;lt;500 AND total_time&amp;gt;=300,total_time,0)&lt;/P&gt;&lt;P&gt;| eval green = if(total_time&amp;lt;300, total_time, 0)&lt;/P&gt;&lt;P&gt;However, none of the examples I have found work because they expect Func(Expression) or&amp;nbsp;if([bool expr], [expr],&amp;nbsp; or some other command combination and not just a Field. Here is the chart with the default Blue. total_response on the Y and _time on the X:&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="ColumnCharBlue.JPG" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9727i4AACFA5EAEEBCF1F/image-size/large?v=v2&amp;amp;px=999" role="button" title="ColumnCharBlue.JPG" alt="ColumnCharBlue.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is an example of what does not work:&lt;/P&gt;&lt;P&gt;index=xxx_website_monitoring sourcetype=web_ping &lt;A href="https://my.website.com" target="_blank" rel="noopener"&gt;https://my.website.com&lt;/A&gt; | stats values(total_time) by _time&lt;/P&gt;&lt;P&gt;| eval red = if(total_time&amp;gt;=500,total_time,0)&lt;/P&gt;&lt;P&gt;| eval yellow = if(total_time&amp;lt;500 AND total_time&amp;gt;=300,total_time,0)&lt;/P&gt;&lt;P&gt;| eval green = if(total_time&amp;lt;300, total_time, 0)&lt;/P&gt;&lt;P&gt;&amp;lt;chart&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;searchName&amp;gt;URLMonitor&amp;lt;/searchName&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;Clarifire URL Response Times&amp;lt;/title&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option name="charting.fieldColors"&amp;gt;{"red":0xFF0000,"yellow":0xFFFF00, "green":0x73A550}&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option name="charting.legend.placement"&amp;gt;none&amp;lt;/option&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;90&amp;lt;/option&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/chart&amp;gt;&lt;/P&gt;&lt;P&gt;Error in 'eval' command: Fields cannot be assigned a boolean result. Instead, try if([bool expr], [expr], [expr]).&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 19:43:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509586#M33950</guid>
      <dc:creator>srewarrior</dc:creator>
      <dc:date>2020-07-16T19:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change Color of Column in Column Chart Based on Field Value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509604#M33952</link>
      <description>&lt;P&gt;sample:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=_internal
| timechart count
| eval status=case(count&amp;gt;100," &amp;gt;100",count&amp;gt;10,"100-10",1=1,"10&amp;gt;")
| chart values(count) as count by _time status&lt;/LI-CODE&gt;&lt;P&gt;How about doing something like this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 20:48:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509604#M33952</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-16T20:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Change Color of Column in Column Chart Based on Field Value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509715#M33962</link>
      <description>&lt;P&gt;This is the problem&amp;nbsp;I have with all the examples so far. Unless I am missing something, I am not&amp;nbsp; count'ing anything. I am not avg'ing. I am not using any function. I simply want to take value in total_response (response time in milliseconds) and graph it in the appropriate color. I am new to Splunk but it seems like a fairly simple task. I have time and response time every five minutes. Nothing super fancy and complicated. I can't believe that no one has thought of this simplistic use case before me. I want my dashboard users to see yellow and red columns for each occurrence when response time hits the appropriate thresholds.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 13:58:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509715#M33962</guid>
      <dc:creator>srewarrior</dc:creator>
      <dc:date>2020-07-17T13:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: Change Color of Column in Column Chart Based on Field Value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509768#M33967</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223409"&gt;@srewarrior&lt;/a&gt;&amp;nbsp;if you would notice the series name in Legend of your screenshot, your stats aggregation is changing the field name from total_time to &lt;STRONG&gt;values(total_time)&lt;/STRONG&gt;. Because of this the field total_time is not available for subsequent eval.&lt;/P&gt;&lt;P&gt;So try changing your search to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xxx_website_monitoring sourcetype=web_ping https://my.website.com
| stats values(total_time) as total_time by _time
| eval red = if(total_time&amp;gt;=500,total_time,0)
| eval yellow = if(total_time&amp;lt;500 AND total_time&amp;gt;=300,total_time,0)
| eval green = if(total_time&amp;lt;300, total_time, 0)
| table _time red, yellow, green&lt;/LI-CODE&gt;&lt;P&gt;Following is a run anywhere example based on the SPL, sample screenshot provided. Please try out and confirm. PS: You would need to replace the run anywhere data generation with your actual index search for SPL to work with your data.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-17 at 11.34.55 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9754i66539E887897E030/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-17 at 11.34.55 PM.png" alt="Screen Shot 2020-07-17 at 11.34.55 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2020-07-17 at 11.08.57 PM.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/9753i2FF0DAB23754CF6F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2020-07-17 at 11.08.57 PM.png" alt="Screen Shot 2020-07-17 at 11.08.57 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;dashboard theme="dark"&amp;gt;
  &amp;lt;label&amp;gt;Color By Range&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;style&amp;gt;
          #total_time_kpi g.highcharts-legend-item text tspan:nth-child(2){
            font-size:110% !important;
            font-weight:bold !important;
            fill:lightgrey !important;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;chart id="total_time_kpi"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| makeresults count=288
| eval delta=300
| accum delta
| eval _time=_time-delta
| eval total_time=substr(tostring(random()),1,3), url="https://clarifier238e601.eclarifier.com"
| table _time total_time url
| search url=TERM("https://clarifier238e601.eclarifier.com")
| stats last(total_time) as total_time by _time
| eval redCritical = if((total_time &amp;amp;gt;= 500),total_time ,0)
| eval yellowWarning = if(total_time &amp;amp;gt;=300 AND total_time &amp;amp;lt;500,total_time ,0)
| eval greenOK = if(total_time &amp;amp;lt;300,total_time ,0)
| table _time redCritical,yellowWarning,greenOK&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;collapsed&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;stacked&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.fieldColors"&amp;gt;{"redCritical":"#DC4E41","yellowWarning":"#F8BE34","greenOK":"#5CC05C"}&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.mode"&amp;gt;seriesCompare&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;right&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.lineWidth"&amp;gt;2&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 18:18:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/509768#M33967</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-17T18:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Change Color of Column in Column Chart Based on Field Value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/510247#M34019</link>
      <description>&lt;P&gt;This last reply worked perfectly. I was able to create chart with the normal theme and with the dark theme. My users will have a choice as to how they want to see the data.&lt;/P&gt;&lt;P&gt;Thank you!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:23:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/510247#M34019</guid>
      <dc:creator>srewarrior</dc:creator>
      <dc:date>2020-07-21T15:23:06Z</dc:date>
    </item>
    <item>
      <title>Re: Change Color of Column in Column Chart Based on Field Value</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/510248#M34020</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/223409"&gt;@srewarrior&lt;/a&gt;&amp;nbsp;Glad your customers have more options. Seems like you Accepted your own answer instead of mine posted above! Kindly correct &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 15:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Change-Color-of-Column-in-Column-Chart-Based-on-Field-Value/m-p/510248#M34020</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-07-21T15:25:18Z</dc:date>
    </item>
  </channel>
</rss>

