<?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: two values in linechart tooltip in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380645#M111386</link>
    <description>&lt;P&gt;Hi sir, have you already solved this? If yes, please do tell. Thanks! &lt;/P&gt;</description>
    <pubDate>Mon, 21 Oct 2019 08:32:19 GMT</pubDate>
    <dc:creator>rajyah</dc:creator>
    <dc:date>2019-10-21T08:32:19Z</dc:date>
    <item>
      <title>two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380637#M111378</link>
      <description>&lt;P&gt;So I have a chart that display the average response time over time. To give more context to my chart. I also want to add the number of events together with the average. Is there a way to do this?&lt;/P&gt;

&lt;P&gt;Example on this screenshot that I edited in paint. I have the average and count in the tooltip.&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/5459iFA5D4C7D2F51C5A6/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;Adding my search query and sample table result&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/5460i89F21C5E0E00D99F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:07:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380637#M111378</guid>
      <dc:creator>michaelrosello</dc:creator>
      <dc:date>2018-07-31T07:07:43Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380638#M111379</link>
      <description>&lt;P&gt;@michaelrosello, ideally you should create a &lt;STRONG&gt;chart overlay with count as Columns and Avg, Min and Max as Overlay fields&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Refer to the documentation: &lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/Chartcontrols#Chart_overlay_example_.28single_axis.29"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/Chartcontrols#Chart_overlay_example_.28single_axis.29&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Chartoverlays"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Chartoverlays&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You should also check out the &lt;STRONG&gt;Outlier Chart Visualization&lt;/STRONG&gt; that &lt;A href="https://splunkbase.splunk.com/app/2890/"&gt;Machine Learning Toolkit App&lt;/A&gt; provides: &lt;A href="http://docs.splunk.com/Documentation/MLApp/latest/User/DetectNumericOutliers"&gt;http://docs.splunk.com/Documentation/MLApp/latest/User/DetectNumericOutliers&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;In case you need to &lt;STRONG&gt;enrich the existing charts Tooltip text&lt;/STRONG&gt; you should refer to @jeffland 's answer : &lt;A href="https://answers.splunk.com/answers/337329/is-it-possible-to-show-a-custom-tooltip-whenever-a.html"&gt;https://answers.splunk.com/answers/337329/is-it-possible-to-show-a-custom-tooltip-whenever-a.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;PS: If you are on version 6.6 or higher you may need to add &lt;CODE&gt;setTimeout()&lt;/CODE&gt; in the Simple XML JS extension script for changes to work: &lt;A href="https://answers.splunk.com/answers/629575/how-to-change-the-dislay-value-in-graph.html"&gt;https://answers.splunk.com/answers/629575/how-to-change-the-dislay-value-in-graph.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:37:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380638#M111379</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-31T07:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380639#M111380</link>
      <description>&lt;P&gt;sadly there is a specific instruction that I go this route. I've been trying that jeffland post but it seems that there are extra steps that they did to make it work that is not in the answer.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 07:55:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380639#M111380</guid>
      <dc:creator>michaelrosello</dc:creator>
      <dc:date>2018-07-31T07:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380640#M111381</link>
      <description>&lt;P&gt;@michaelrosello I have converted my answer to comment. &lt;/P&gt;

&lt;P&gt;Can you please add more details on what would your table with avg and count information look like? If possible add your current query as well which will give the tabular result. Mask out or anonymize any sensitive information in the tabular data before posting.&lt;/P&gt;

&lt;P&gt;Is Count applicable for specific time selected (for corresponding Avg) or is it overall?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 08:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380640#M111381</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-31T08:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380641#M111382</link>
      <description>&lt;P&gt;@niketnilay I've updated my question with sample query and data in table. I also think @jeffland answer doesn't work on 7.x version&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 08:58:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380641#M111382</guid>
      <dc:creator>michaelrosello</dc:creator>
      <dc:date>2018-07-31T08:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380642#M111383</link>
      <description>&lt;P&gt;@michaelrosello as mentioned in one of the above answers &lt;CODE&gt;setTimeout()&lt;/CODE&gt; will be required as a workaround to apply JS on chart element. However, I will try to have a look at this later today (or may be over the weekend! I have converted my answer to comment so that others may help if they cook up working example first :))&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jul 2018 11:03:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380642#M111383</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-07-31T11:03:04Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380643#M111384</link>
      <description>&lt;P&gt;Thanks. I did that, but based on my testing. it works on 6.6 but not on 7.0, It seem it has to do with how the css class is being reference&lt;/P&gt;</description>
      <pubDate>Wed, 01 Aug 2018 00:58:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380643#M111384</guid>
      <dc:creator>michaelrosello</dc:creator>
      <dc:date>2018-08-01T00:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380644#M111385</link>
      <description>&lt;P&gt;So far this what I came up to. I was able to add a new row but I can only add the word count and the value is not displaying.&lt;/P&gt;

&lt;P&gt;Average :30&lt;BR /&gt;
Count:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'underscore',
     'jquery',
     'splunkjs/mvc',
     'splunkjs/mvc/searchmanager',
     'splunkjs/mvc/simplexml/ready!'
 ], function (_, $, mvc, SearchManager) {
     // get the search manager
     var search = splunkjs.mvc.Components.getInstance("line");
     // get its results
     var myResults = search.data("results");
     var resultArray = [];
     myResults.on("data", function() {
         resultArray = myResults.data().rows;
     });
     // add info when opening tooltip (delegate event listening)
     $(document).on("mouseover", "#chart g.highcharts-series-group &amp;gt; g.highcharts-series-hover", function(){
         // get title to compare which series of the chart we're looking at
          setTimeout(function(){
         var title = $(".highcharts-tooltip tbody tr:nth-child(1) td:nth-child(2)").text();
         // select right row
         var Count = "";
         for (var i = 0; i &amp;lt; resultArray.length; i++){
             if (title == resultArray[i][0]){
                 Count = resultArray[i][5];

                 break;
             }
         }

         // add (or change) the date shown in the tooltip
         var text = '&amp;lt;tr class="unique"&amp;gt;&amp;lt;td style="text-align: left; color: #cccccc; max-width: 663.9180019451253px;"&amp;gt;Count&amp;lt;/td&amp;gt;&amp;lt;td style="text-align: right; color: #ffffff; max-width: 572.0819980548747px;"&amp;gt;';
         if ($("table.highcharts-tooltip &amp;gt; tbody").find("tr.unique").length == 0) {
             $("table.highcharts-tooltip &amp;gt; tbody").append(text+Count+'&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;');
         } else {
             $("table.highcharts-tooltip &amp;gt; tbody &amp;gt; tr.unique").replaceWith(text+Count+'&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;');
         }
         // re-calculate the size of the black box behind the text
         var height = $("table.highcharts-tooltip").height();
         var width = $("table.highcharts-tooltip").width();
         var node = $("g.highcharts-tooltip")[0];
         var bbox = node.getBBox();
         var w = width / bbox.width;
         var h = height / bbox.height;
         var scalex = w*1.15, scaley = h*1.15;
         var scalestr = scalex + ',' + scaley;
         var regex = /(\w+\(\d+\,\d+\))/; // one way to make sure we only add scale once
         node.setAttribute('transform',regex.exec(node.getAttribute("transform"))[0]+'scale('+scalestr+')');
         }, 15);
     });
 }); 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Aug 2018 01:20:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380644#M111385</guid>
      <dc:creator>michaelrosello</dc:creator>
      <dc:date>2018-08-02T01:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: two values in linechart tooltip</title>
      <link>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380645#M111386</link>
      <description>&lt;P&gt;Hi sir, have you already solved this? If yes, please do tell. Thanks! &lt;/P&gt;</description>
      <pubDate>Mon, 21 Oct 2019 08:32:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/two-values-in-linechart-tooltip/m-p/380645#M111386</guid>
      <dc:creator>rajyah</dc:creator>
      <dc:date>2019-10-21T08:32:19Z</dc:date>
    </item>
  </channel>
</rss>

