Dashboards & Visualizations

How i can Add tooltip to panel on a hover

hrs2019
Path Finder

Hello everyone,
How i can Add tooltip to a panel on a hover so that if i select in panel anywhere it shows the tooltip.
now it is showing only when I click count but my requirement is wherever I will select in the panel its will shows the message.

i have used below XML

<dashboard theme="dark">
  <label></label>
  <row>
    <panel id="panel1">
      <title></title>
      <html>
         <style>

           }
           .custom-tooltip:hover:after{
             background: #33323 ;
             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;
         }

         </style>
         <a title="These are high severity Count. Click on the count to view the details." class="custom-tooltip">Count</a>
       </html>
      <single>
        <title></title>
        <search>
          <query>|inputlookup TEST1001.csv 
| eval count = if(ProjectName="CNB", "200", count) 
| eval count = if(ProjectName="PPN", "400", count)
| eval count = if(ProjectName="LLP", "400", count)
| eval count = if(ProjectName="DDF", "600", count)
| stats sum(count) as Tottle</query>
          <earliest>0</earliest>
          <done>
            <set token="tokToolTipText1">Tooltip1: Search returned $job.Tottle$ Results!</set>
          </done>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="colorMode">block</option>
        <option name="drilldown">none</option>
        <option name="rangeColors">["0x53a051","0x0877a6","0xf8be34","0xf1813f","0xdc4e41"]</option>
        <option name="useColors">1</option>
      </single>
    </panel>
  </row>
</dashboard>

alt text

0 Karma
1 Solution

niketn
Legend

@hrs2019 refer to one of my older answers: https://answers.splunk.com/answers/236389/adding-tooltip-to-panel-on-a-hover.html , will require Simple XML JS extension to handle panel hover event and setting/unsetting tokens based on the same!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@hrs2019 refer to one of my older answers: https://answers.splunk.com/answers/236389/adding-tooltip-to-panel-on-a-hover.html , will require Simple XML JS extension to handle panel hover event and setting/unsetting tokens based on the same!

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

hrs2019
Path Finder

Hi @niketnilay your given link is not working for me.

0 Karma

vnravikumar
Champion

There is a comma at the end of the link, remove that comma and try it
https://answers.splunk.com/answers/236389/adding-tooltip-to-panel-on-a-hover.html

0 Karma

hrs2019
Path Finder

Hi @niketnilay Thanks for your help I was trying this answer before posting but for me, it was not working that's why I have posted my XML code.
Could you pls help me I want to use in XML only since i am a power user and don't have admin access.

0 Karma

hrs2019
Path Finder

Hi @niketnilay they were a js issue in my code I fixed that now it is working fine.
Thank you so much for your help easy and simple is your solution.

niketn
Legend

What was not working? Did you place JS file in the right location? Did you bump, refresh or restart Splunk (depending on environmental where you are trying)? Did you enable console logs in JS file to see whether you are getting any errors. Try manually setting/unsetting the token through dashboard code and see whether tooltip appears and hides as expected or not.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...