<?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: How do you create the below chart in Splunk? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442614#M125621</link>
    <description>&lt;P&gt;It is not good for Splunk to put graph elements in a table. It is only a spark line.&lt;BR /&gt;
I think that the graph on the right side is a spark line and the others are expressed by table data. &lt;BR /&gt;
Changing the color of the row(Negative,Neutral,Positive) makes it look better a little.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Oct 2018 08:51:14 GMT</pubDate>
    <dc:creator>HiroshiSatoh</dc:creator>
    <dc:date>2018-10-24T08:51:14Z</dc:date>
    <item>
      <title>How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442612#M125619</link>
      <description>&lt;P&gt;I am working on Sentiment Analysis for twitter logs. The client requirement is to produce the graph/chart as mentioned in the below image. I have the data of TwitterText, Sentiment,Score, Location, TwitterID, TwitterName, TwitterTimestamp, TwitterDate. I am also getting the Twitter feed to Splunk at every 1 minute. Kindly advise how best we can plot the chart as per below&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 02:33:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442612#M125619</guid>
      <dc:creator>aravindpadmin</dc:creator>
      <dc:date>2018-10-24T02:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442613#M125620</link>
      <description>&lt;P&gt;I have a requirement on Sentiment Analysis on Twitter for my organisation. I have a data for TwitterText, Name, Location, Sentiment (Positive/Negative/Neutral), Score, Location, Date, Time. I need to plot the graph as mentioned above with respect to applications. How best this can be achieved?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 02:37:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442613#M125620</guid>
      <dc:creator>aravindpadmin</dc:creator>
      <dc:date>2018-10-24T02:37:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442614#M125621</link>
      <description>&lt;P&gt;It is not good for Splunk to put graph elements in a table. It is only a spark line.&lt;BR /&gt;
I think that the graph on the right side is a spark line and the others are expressed by table data. &lt;BR /&gt;
Changing the color of the row(Negative,Neutral,Positive) makes it look better a little.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 08:51:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442614#M125621</guid>
      <dc:creator>HiroshiSatoh</dc:creator>
      <dc:date>2018-10-24T08:51:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442615#M125622</link>
      <description>&lt;P&gt;hi @aravindpadmin,&lt;/P&gt;

&lt;P&gt;Did the answer below solve your problem? If so, please resolve this post by approving it! If your problem is still not solved, keep us updated so that someone else can help ya. Thanks for posting!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Oct 2018 20:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442615#M125622</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-10-24T20:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442616#M125623</link>
      <description>&lt;P&gt;@HiroshiSatoh , thanks for your response. Is there any way to color the count of Sentiment (positive or Negative or Neutral count) based on value of the count? Example, if there are 5 positive 3 negative and 10 nuetral tweets for application ATM. Then ATM app should be displayed with background colour green with it length extended based on number of tweets received.&lt;/P&gt;

&lt;P&gt;I want this one look similar to Gant chart. Please advise.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 01:33:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442616#M125623</guid>
      <dc:creator>aravindpadmin</dc:creator>
      <dc:date>2018-10-30T01:33:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442617#M125624</link>
      <description>&lt;P&gt;@aravindpadmin here is a run anywhere example with some cooked up data from Splunk's _internal index to mimic a scenario for Sentiments Negative, Neutral and Positive (PS: as stated not based on actual sentiment data).&lt;/P&gt;

&lt;P&gt;The example usese &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML#Table_sparklines"&gt;Table Sparkline Formatting options&lt;/A&gt; and extending &lt;CODE&gt;Table with Data Bars&lt;/CODE&gt; example from &lt;A href="https://splunkbase.splunk.com/app/1603/"&gt;Splunk Dashboard Examples&lt;/A&gt; app.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5974i523486F749C630CD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Following is the Simple XML Dashboard Code:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form script="table_with_multiple_data_bars.js"&amp;gt;
  &amp;lt;label&amp;gt;Sentiments table with colored Data Bars and Sparklines&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;&amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;input type="time" token="tokTime" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;&amp;lt;/label&amp;gt;
        &amp;lt;default&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;/default&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;html depends="$alwaysHideCSSStylePanel$"&amp;gt;
        &amp;lt;style&amp;gt;
          .data-bar-cell{
            padding: 4px 8px;
          }
          .data-bar-tooltip{
              height: 16px;
              min-width: 0px;
              text-align:center;
              color:white;
          }          
          .data-bar-tooltip .data-bar-tooltip-text{
            visibility: hidden;
            background-color: black;
            color: #fff;
            text-align: center;
            border-radius: 6px;
            padding: 2px 5px;
            /* Position the tooltip */
            position: relative;
            top:-15px;
            z-index: 1;
          }
          .data-bar-tooltip:hover .data-bar-tooltip-text {
              visibility: visible;
          }
          .data-bar-tooltip.negative{
              background: #ff0000;
          }
          .data-bar-tooltip.neutral{
              background: #D2691E;
          }
          .data-bar-tooltip.positive{
              background: #008000;
          }          
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
      &amp;lt;table id="tableWithMultipleDataBars"&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunkd log_level="*"
| stats count(eval(date_second&amp;gt;0 AND date_second&amp;lt;=20)) as Negative count(eval(date_second&amp;gt;20 AND date_second&amp;lt;=40)) as Neutral count(eval(date_second&amp;gt;40 AND date_second&amp;lt;=60)) as Positive sparkline(count(eval(date_second&amp;gt;0 AND date_second&amp;lt;=20))) as Negative_Sparkline sparkline(count(eval(date_second&amp;gt;20 AND date_second&amp;lt;=40))) as Neutral_Sparkline sparkline(count(eval(date_second&amp;gt;40 AND date_second&amp;lt;=60))) as Positive_Sparkline by component
| eval sentiment=Negative."|".Neutral."|".Positive
| table component sentiment Negative_Sparkline Neutral_Sparkline Positive_Sparkline&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$tokTime.earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$tokTime.latest$&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="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;format field="Negative_Sparkline" type="sparkline"&amp;gt;
          &amp;lt;option name="lineColor"&amp;gt;#ff0000&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format field="Neutral_Sparkline" type="sparkline"&amp;gt;
          &amp;lt;option name="lineColor"&amp;gt;#D2691E&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format field="Positive_Sparkline" type="sparkline"&amp;gt;
          &amp;lt;option name="lineColor"&amp;gt;#008000&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the required JavaScript extension file &lt;CODE&gt;table_with_multiple_data_bars.js&lt;/CODE&gt; with Splunk JS code to render Data Bars with Tooltips in required table cell. PS: Negative, Neutral and Positive values in &lt;CODE&gt;sentiments&lt;/CODE&gt; column need to be present with Pipe &lt;CODE&gt;|&lt;/CODE&gt; as delimiter character i.e. there should value of &lt;CODE&gt;0&lt;/CODE&gt; instead of null. Also the table with Sentiments data bar should have &lt;CODE&gt;id="tableWithMultipleDataBars"&lt;/CODE&gt; for the changes to work. PS: Since this example requires Static changes (JavaScript file), you may need to refresh, bump or restart your Splunk changes depending on your environment and debug settings. Also typically you need to put the JS file under your Splunk App's appserver/static folder i.e. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;yourAppName&amp;gt;/appserver/static&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
    'jquery',
    'underscore',
    'splunkjs/mvc',
    'views/shared/results_table/renderers/BaseCellRenderer',
    'splunkjs/mvc/simplexml/ready!'
], function($, _, mvc, BaseCellRenderer) {
    console.log("Script Started");
    var DataBarCellRenderer = BaseCellRenderer.extend({
        canRender: function(cell) {
            return (cell.field === 'sentiment');
        },
        render: function($td, cell) {
            var negative = parseInt(cell.value.split("|")[0]);
            var neutral = parseInt(cell.value.split("|")[1]);
            var positive = parseInt(cell.value.split("|")[2]);
            var total=negative+neutral+positive;
            var negative_percent,neutral_percent,positive_percent;
            if(total==0){
                negative_percent=0.00;
                neutral_percent=0.00;
                positive_percent=0.00;
                negative=0;
                neutral=0;
                positive=0;
            }else{
                negative_percent=((negative/total)*100).toFixed(2);
                neutral_percent=((neutral/total)*100).toFixed(2);
                positive_percent=((positive/total)*100).toFixed(2);
            }
            $td.addClass('data-bar-cell').html(_.template(
               '&amp;lt;div class="data-bar-container" style="display:flex"&amp;gt;'+
                  '&amp;lt;div class="data-bar-tooltip negative" style="width:&amp;lt;%- negative_percent %&amp;gt;%;"&amp;gt;&amp;lt;%- negative %&amp;gt;'+
                     '&amp;lt;span class="data-bar-tooltip-text negative"&amp;gt;&amp;lt;%- negative_percent %&amp;gt;%&amp;lt;/span&amp;gt;'+
                  '&amp;lt;/div&amp;gt;'+
                  '&amp;lt;div class="data-bar-tooltip neutral" style="width:&amp;lt;%- neutral_percent %&amp;gt;%;"&amp;gt;&amp;lt;%- neutral %&amp;gt;'+
                     '&amp;lt;span class="data-bar-tooltip-text neutral"&amp;gt;&amp;lt;%- neutral_percent %&amp;gt;%&amp;lt;/span&amp;gt;'+
                  '&amp;lt;/div&amp;gt;'+
                  '&amp;lt;div class="data-bar-tooltip positive" style="width:&amp;lt;%- positive_percent %&amp;gt;%;"&amp;gt;&amp;lt;%- positive %&amp;gt;'+
                     '&amp;lt;span class="data-bar-tooltip-text positive"&amp;gt;&amp;lt;%- positive_percent %&amp;gt;%&amp;lt;/span&amp;gt;'+
                  '&amp;lt;/div&amp;gt;'+
               '&amp;lt;/div&amp;gt;', {
                negative_percent: negative_percent,
                negative: negative,
                neutral_percent: neutral_percent,
                neutral: neutral,
                positive_percent: positive_percent,
                positive: positive
            }));
        }
    });
    mvc.Components.get('tableWithMultipleDataBars').getVisualization(function(tableView) {
        tableView.addCellRenderer(new DataBarCellRenderer());
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have used built in sparkline feature and used Sparkline formatting to apply lineColor to sparklines as per their category. I did not overly the sparkline as it would be possible to draw &lt;CODE&gt;tristate sparkline&lt;/CODE&gt; over a period of time, provided your stats/chart query for &lt;CODE&gt;sparkline()&lt;/CODE&gt; can generate three type of values i.e. &lt;CODE&gt;-1 for Loss&lt;/CODE&gt;, &lt;CODE&gt;0 for Draw&lt;/CODE&gt; or &lt;CODE&gt;1 for Win&lt;/CODE&gt;. Refer to my Splunk wiki talk &lt;A href="http://wiki.splunk.com/User_talk:Niketnilay#Topic_11:_Types_of_jQuery_Sparklines_in_Splunk_.28besides_Line_and_Bar_that_we_know_:.29.29"&gt;Topic 11: Types of jQuery Sparklines in Splunk (besides Line and Bar that we know :))&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Or the following run anywhere example to generate some &lt;CODE&gt;tristate sparkline&lt;/CODE&gt; :&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5975i0AFE51C9E2138863/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Following is the Simple XML Dashboard code for above example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Sparkline tristate&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| gentimes start=-10 increment=1d
| eval _time=starttime
| fields _time
| eval random=random()%2
| streamstats count as sno
| eval random=if(sno==2 OR sno==7,-1,random)
| bin _time span=1d
| stats sparkline(max(random)) as tristate avg(random) as average
| table average tristate&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-1s&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="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
        &amp;lt;format type="number" field="average"&amp;gt;
          &amp;lt;option name="precision"&amp;gt;0&amp;lt;/option&amp;gt;
          &amp;lt;option name="useThousandSeparators"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
        &amp;lt;format field="tristate" type="sparkline"&amp;gt;
          &amp;lt;option name="type"&amp;gt;tristate&amp;lt;/option&amp;gt;
        &amp;lt;/format&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Nov 2018 21:41:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442617#M125624</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-11-06T21:41:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do you create the below chart in Splunk?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442618#M125625</link>
      <description>&lt;P&gt;@aravindpadmin can you please confirm whether the above option worked for you?&lt;/P&gt;</description>
      <pubDate>Tue, 14 Apr 2020 02:55:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-you-create-the-below-chart-in-Splunk/m-p/442618#M125625</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-04-14T02:55:29Z</dc:date>
    </item>
  </channel>
</rss>

