<?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 change the colour of the value based on the range in statistics table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499506#M195015</link>
    <description>&lt;P&gt;How to change the color of the value based on the range in statistics table visualization &lt;/P&gt;</description>
    <pubDate>Fri, 31 Jan 2020 06:31:01 GMT</pubDate>
    <dc:creator>shruthiangadi</dc:creator>
    <dc:date>2020-01-31T06:31:01Z</dc:date>
    <item>
      <title>How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499506#M195015</link>
      <description>&lt;P&gt;How to change the color of the value based on the range in statistics table visualization &lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 06:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499506#M195015</guid>
      <dc:creator>shruthiangadi</dc:creator>
      <dc:date>2020-01-31T06:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499507#M195016</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Check the following link&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsXML&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsFormatting#Format_table_columns"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/TableFormatsFormatting#Format_table_columns&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 09:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499507#M195016</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-01-31T09:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499508#M195017</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I tried in the above link which you provided but it will change the whole cell background not the cell value.&lt;/P&gt;

&lt;P&gt;Means it will change the colour of the cell instead of value present in that field.&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 09:44:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499508#M195017</guid>
      <dc:creator>shruthiangadi</dc:creator>
      <dc:date>2020-01-31T09:44:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499509#M195018</link>
      <description>&lt;P&gt;You can customize through css and javascript&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 09:54:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499509#M195018</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-01-31T09:54:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499510#M195019</link>
      <description>&lt;P&gt;Check this&lt;/P&gt;

&lt;P&gt;xml:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="test.js"&amp;gt;
  &amp;lt;label&amp;gt;table color&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table id="highlight"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults count=100 |streamstats count&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;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
      &amp;lt;style&amp;gt;
          #highlight .blue {
              color: blue; !important;
          }
           #highlight .green {
              color: green; !important;
          }
          #highlight .red {
              color: red; !important;
          }
      &amp;lt;/style&amp;gt;
    &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;javascript:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    'underscore',
    'jquery',
    'splunkjs/mvc',
    'splunkjs/mvc/tableview',
    'splunkjs/mvc/simplexml/ready!'
], function(_, $, mvc, TableView) {

    var CustomRangeRenderer = TableView.BaseCellRenderer.extend({
        canRender: function(cell) {

            return _([ 'count']).contains(cell.field);
        },
        render: function($td, cell) {

            var value = String(cell.value);

            if (cell.field === 'count') {
                 if (value &amp;gt; 0 &amp;amp;&amp;amp; value &amp;lt;=30){
                    $td.addClass('blue');
                }else  if (value &amp;gt; 30 &amp;amp;&amp;amp; value &amp;lt;=70){
                    $td.addClass('green');
                } if (value &amp;gt; 70 &amp;amp;&amp;amp; value &amp;lt;=100){
                    $td.addClass('red');
                }
            }
            $td.text(value).addClass('numeric');
        }
    });
    mvc.Components.get('highlight').getVisualization(function(tableView) {

        tableView.table.addCellRenderer(new CustomRangeRenderer());
        tableView.on('rendered', function() {

            tableView.$el.find('td.range-cell').each(function() {
                $(this).parents('tr').addClass(this.className);
            });
        });

        tableView.table.render();
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 31 Jan 2020 10:13:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499510#M195019</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2020-01-31T10:13:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499511#M195020</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;Ok will check thank you&lt;/P&gt;</description>
      <pubDate>Fri, 31 Jan 2020 10:14:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499511#M195020</guid>
      <dc:creator>shruthiangadi</dc:creator>
      <dc:date>2020-01-31T10:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to change the colour of the value based on the range in statistics table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499512#M195021</link>
      <description>&lt;P&gt;@vnravikumar I would suggest you to clarify poster requirement before posting an answer so that the question gets proper attention from other community experts as they would otherwise ignore such questions as already answered. Under such case the poster would be forced to post a new question with updated requirements for gaining proper attention. Which happened in this case. Nevertheless as per details provided by @shruthiangadi seems like the Code provided in the comment above is appropriate answer rather than the original Splunk Docs links provided. (PS: might need a setTimeout inside render function due to table JS extension bug)&lt;/P&gt;

&lt;P&gt;Up-voting the answer above!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Feb 2020 06:31:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-change-the-colour-of-the-value-based-on-the-range-in/m-p/499512#M195021</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-02-06T06:31:02Z</dc:date>
    </item>
  </channel>
</rss>

