<?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 can I display threshold values when hover over single value visualization in dashboard ? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469017#M30796</link>
    <description>&lt;P&gt;how can I display threshold values when hover over single value visualization in dashboard ?&lt;/P&gt;

&lt;P&gt;I have referred to answers and figured out the below css . how can I implement the effect to single value visualization panel ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
  &amp;lt;html&amp;gt;
     &amp;lt;style&amp;gt;


       .custom-tooltip{
           display: inline;
           position: absolute;
       }
       .custom-tooltip:hover:after{
         background: #333 ;
         background: rgba(0,0,0,.8) ;
         border-radius: 5px ;
         bottom: 26px ;
         color: #fff ;
         content: attr(title) ;
         left: 20% ;
         padding: 5px 15px ;
         position: absolute ;
         z-index: 98;
         width: 220px;
     }
     .custom-tooltip:hover:before{
       border: solid;
       border-color: #333 transparent;
       border-width: 6px 6px 0 6px;
       bottom: 20px ;
       content: "" ;
       left: 50% ;
       position: absolute ;
       z-index: 99 ;
       }
     &amp;lt;/style&amp;gt;
     &amp;lt;a title="Splunk" class="custom-tooltip"&amp;gt;Splunk is great&amp;lt;/a&amp;gt;
   &amp;lt;/html&amp;gt;
&amp;lt;/panel&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;single&amp;gt;
    &amp;lt;title&amp;gt;testing&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;|makeresults |eval a ="100"&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;/single&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Apr 2020 12:54:28 GMT</pubDate>
    <dc:creator>ssadanala1</dc:creator>
    <dc:date>2020-04-06T12:54:28Z</dc:date>
    <item>
      <title>how can I display threshold values when hover over single value visualization in dashboard ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469017#M30796</link>
      <description>&lt;P&gt;how can I display threshold values when hover over single value visualization in dashboard ?&lt;/P&gt;

&lt;P&gt;I have referred to answers and figured out the below css . how can I implement the effect to single value visualization panel ?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;panel&amp;gt;
  &amp;lt;html&amp;gt;
     &amp;lt;style&amp;gt;


       .custom-tooltip{
           display: inline;
           position: absolute;
       }
       .custom-tooltip:hover:after{
         background: #333 ;
         background: rgba(0,0,0,.8) ;
         border-radius: 5px ;
         bottom: 26px ;
         color: #fff ;
         content: attr(title) ;
         left: 20% ;
         padding: 5px 15px ;
         position: absolute ;
         z-index: 98;
         width: 220px;
     }
     .custom-tooltip:hover:before{
       border: solid;
       border-color: #333 transparent;
       border-width: 6px 6px 0 6px;
       bottom: 20px ;
       content: "" ;
       left: 50% ;
       position: absolute ;
       z-index: 99 ;
       }
     &amp;lt;/style&amp;gt;
     &amp;lt;a title="Splunk" class="custom-tooltip"&amp;gt;Splunk is great&amp;lt;/a&amp;gt;
   &amp;lt;/html&amp;gt;
&amp;lt;/panel&amp;gt;


&amp;lt;panel&amp;gt;
  &amp;lt;single&amp;gt;
    &amp;lt;title&amp;gt;testing&amp;lt;/title&amp;gt;
    &amp;lt;search&amp;gt;
      &amp;lt;query&amp;gt;|makeresults |eval a ="100"&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;/single&amp;gt;
&amp;lt;/panel&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Apr 2020 12:54:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469017#M30796</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2020-04-06T12:54:28Z</dc:date>
    </item>
    <item>
      <title>Re: how can I display threshold values when hover over single value visualization in dashboard ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469018#M30797</link>
      <description>&lt;P&gt;@ssadanala1 based on your question seems like you want to show static tooltip with threshold when there is mouse-hover on Single Value panel.&lt;/P&gt;

&lt;P&gt;The tooltip can be added through html panel similar to what you have shared (refer to Splunk Style Doc for reference of tooltip : &lt;CODE&gt;&lt;A href="http://&amp;lt;yourSplunkInstance&amp;gt;:8000/en-US/static/docs/style/style-guide.html#tooltips" target="test_blank"&gt;http://&amp;lt;yourSplunkInstance&amp;gt;:8000/en-US/static/docs/style/style-guide.html#tooltips&lt;/A&gt;&lt;/CODE&gt; ). However, in order to show/hide the tooltip based on &lt;CODE&gt;mouseover()&lt;/CODE&gt; in and &lt;CODE&gt;mouseout()&lt;/CODE&gt; events you would need Simple XML JS extension and also SplunkJS stack to access tokens to send the value back from JS to Simple XML dashboard.&lt;/P&gt;

&lt;P&gt;You can refer to one of my older answers to show a tooltip (dynamic in that case) on mouse hovering over a Radial Gauge: &lt;A href="https://answers.splunk.com/answers/586554/is-it-possible-to-do-mouseover-hint-on-a-radio-gau.html"&gt;https://answers.splunk.com/answers/586554/is-it-possible-to-do-mouseover-hint-on-a-radio-gau.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;On similar lines you would need to code:&lt;BR /&gt;
&lt;STRONG&gt;1.&lt;/STRONG&gt;  An &lt;CODE&gt;&amp;lt;html&amp;gt;&lt;/CODE&gt; panel for tooltip with depends on a token that will be set from Simple XML JS&lt;BR /&gt;
&lt;STRONG&gt;2.&lt;/STRONG&gt;  CSS Style overrides to ensure tooltip shows up in the correctly with respect to the Single Value.&lt;BR /&gt;
&lt;STRONG&gt;3.&lt;/STRONG&gt;  JS Extension to set the token to show html tooltip on &lt;CODE&gt;mouseover()&lt;/CODE&gt; and unset the token on &lt;CODE&gt;mouseout()&lt;/CODE&gt; based on the Single Value chart ID based jQuery selector.&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/8645iCBDF266A14478CD0/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 Run anywhere example Simple XML Code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="single_value_tooltip_on_mousehover.js"&amp;gt;
  &amp;lt;label&amp;gt;Single Value with Threshold on hover&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;single id="singleThreshold"&amp;gt;
        &amp;lt;title&amp;gt;testing&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;|makeresults |eval a ="100"&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="colorMode"&amp;gt;block&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeColors"&amp;gt;["0x53a051","0xf8be34","0xf1813f","0xdc4e41"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="rangeValues"&amp;gt;[60,80,90]&amp;lt;/option&amp;gt;
        &amp;lt;option name="useColors"&amp;gt;1&amp;lt;/option&amp;gt;
      &amp;lt;/single&amp;gt;
      &amp;lt;html id="htmlToolTipSingleThreshold" depends="$tokShowSingleThresholdToolTip$"&amp;gt;
        &amp;lt;style&amp;gt;
          #htmlToolTipSingleThreshold{
            margin:auto !important;
            width: 20% !important;
            position:relative;
            top:-250px;
          }
          div.div_threshold_row{
            display:flex;
            padding-bottom:5px;
          }
          div.div_threshold_range{
            width: 80px;
          }
          div.div_threshold_delim{
            padding-right:5px;
          }
          div.div_threshold_color{
            width:20px;
            height:20px;
          }
          div#div_threshold_color_green{
            background:#53a051;
          }
          div#div_threshold_color_yellow{
            background:#f8be34;
          }
          div#div_threshold_color_orange{
            background:#f1813f;
          }
          div#div_threshold_color_red{
            background:#dc4e41;
          }
        &amp;lt;/style&amp;gt;
           &amp;lt;div class="tooltip fade top in"&amp;gt;
             &amp;lt;div class="tooltip-arrow"/&amp;gt;
             &amp;lt;div class="tooltip-inner"&amp;gt;
              &amp;lt;div class="div_threshold_row"&amp;gt;
                &amp;lt;div class="div_threshold_range"&amp;gt;min to 60&amp;lt;/div&amp;gt;&amp;lt;div class="div_threshold_delim"&amp;gt;:&amp;lt;/div&amp;gt;&amp;lt;div id="div_threshold_color_green" class="div_threshold_color"&amp;gt;&amp;lt;/div&amp;gt;
              &amp;lt;/div&amp;gt;
              &amp;lt;div class="div_threshold_row"&amp;gt;
                &amp;lt;div class="div_threshold_range"&amp;gt;60 to 80&amp;lt;/div&amp;gt;&amp;lt;div class="div_threshold_delim"&amp;gt;:&amp;lt;/div&amp;gt;&amp;lt;div id="div_threshold_color_yellow" class="div_threshold_color"&amp;gt;&amp;lt;/div&amp;gt;
              &amp;lt;/div&amp;gt;
              &amp;lt;div class="div_threshold_row"&amp;gt;
                &amp;lt;div  class="div_threshold_range"&amp;gt;80 to 90&amp;lt;/div&amp;gt;&amp;lt;div class="div_threshold_delim"&amp;gt;:&amp;lt;/div&amp;gt;&amp;lt;div id="div_threshold_color_orange" class="div_threshold_color"&amp;gt;&amp;lt;/div&amp;gt;
              &amp;lt;/div&amp;gt;
              &amp;lt;div class="div_threshold_row"&amp;gt;
                &amp;lt;div class="div_threshold_range"&amp;gt;90 to max&amp;lt;/div&amp;gt;&amp;lt;div class="div_threshold_delim"&amp;gt;:&amp;lt;/div&amp;gt;&amp;lt;div  id="div_threshold_color_red" class="div_threshold_color"&amp;gt;&amp;lt;/div&amp;gt;
              &amp;lt;/div&amp;gt;
             &amp;lt;/div&amp;gt;
           &amp;lt;/div&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;And required JS code (&lt;CODE&gt;single_value_tooltip_on_mousehover.js&lt;/CODE&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; require(["splunkjs/mvc", 
         "jquery", 
         "splunkjs/ready!", 
         "splunkjs/mvc/simplexml/ready!"    
     ], function( mvc, 
     $){
         var defaultTokens = mvc.Components.get("default");
         var submittedTokens = mvc.Components.get("submitted");

         //jQuery to access Single Value with ID. 
         //On mouseover() event set the show token for the Tooltip 
         $('#singleThreshold .splunk-single').on("mouseover",function(){ 
             defaultTokens.set("tokShowSingleThresholdToolTip", "true");
             submittedTokens.set("tokShowSingleThresholdToolTip", "true");
         }); 

         //On mouseout() event unset the show token for the Tooltip to hide the same. 
         $('#singleThreshold .splunk-single').on("mouseout",function(){ 
             defaultTokens.unset("tokShowSingleThresholdToolTip");
             submittedTokens.unset("tokShowSingleThresholdToolTip");
         }); 
     });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please try out and confirm.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Apr 2020 17:08:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469018#M30797</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-04-06T17:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: how can I display threshold values when hover over single value visualization in dashboard ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469019#M30798</link>
      <description>&lt;P&gt;Thanks Very Much for your help . Stay Safe &lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 18:16:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469019#M30798</guid>
      <dc:creator>ssadanala1</dc:creator>
      <dc:date>2020-04-12T18:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: how can I display threshold values when hover over single value visualization in dashboard ?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469020#M30799</link>
      <description>&lt;P&gt;Thanks! You 2!&lt;/P&gt;</description>
      <pubDate>Sun, 12 Apr 2020 18:18:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/how-can-I-display-threshold-values-when-hover-over-single-value/m-p/469020#M30799</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2020-04-12T18:18:21Z</dc:date>
    </item>
  </channel>
</rss>

