All Apps and Add-ons

Set-Unset token in Drilldown Visualisation

sarvesh_11
Communicator

Hi Splunkers,
I have donut visualisation in my dashboard (screenshot attached).
Since we do not have drilldown functionality inbuilt in https://splunkbase.splunk.com/app/3238/
I have written js for click events on donut slice.
I have tried with submitted, unsubmitted logic, used set and unset logic too, but doesnt seems to resolve my issue.
here is my js:

require(["splunkjs/mvc",
"jquery",
"splunkjs/ready!",
"splunkjs/mvc/simplexml/ready!"
], function( mvc,
$){
var defaultTokenModel=mvc.Components.get("default");
var submittedTokenModel=mvc.Components.get("submitted");

      $(document).on("click","#payment_css g.c3-chart-arc.c3-target-Warning",function(){
         defaultTokenModel.set("color","Warning");
         submittedTokenModel.set("color","Warning");
         defaultTokenModel.set("alert","mobile");
         submittedTokenModel.set("alert","mobile");
      });

      $(document).on("click","#payment_css g.c3-chart-arc.c3-target-Critical",function(){
         defaultTokenModel.set("color","Critical");
         submittedTokenModel.set("color","Critical");
         defaultTokenModel.set("alert","mobile");
         submittedTokenModel.set("alert","mobile");
      });

$(document).on("click","#payment_css g.c3-chart-arc.c3-target-Normal",function(){
defaultTokenModel.set("color","Normal");
submittedTokenModel.set("color","Normal");
defaultTokenModel.set("alert","mobile");
submittedTokenModel.set("alert","mobile");
});

$(document).on("click","#freedisk_css g.c3-chart-arc.c3-target-Warning",function(){
defaultTokenModel.set("color","Warning");
submittedTokenModel.set("color","Warning");
defaultTokenModel.set("alert","freedisk");
submittedTokenModel.set("alert","freedisk");
});

      $(document).on("click","#freedisk_css g.c3-chart-arc.c3-target-Critical",function(){
         defaultTokenModel.set("color","Critical");
         submittedTokenModel.set("color","Critical");
         defaultTokenModel.set("alert","freedisk");
         submittedTokenModel.set("alert","freedisk");
      });

      $(document).on("click","#freedisk_css g.c3-chart-arc.c3-target-Normal",function(){
         defaultTokenModel.set("color","Normal");
         submittedTokenModel.set("color","Normal");
         defaultTokenModel.set("alert","freedisk");
         submittedTokenModel.set("alert","freedisk");
      });

});

in above js, token: alert is my panel dependent and token color is donut slice dependent.
Issue is : i have different table for both of these alert i,e Mobile and freedisk , in my xml i have given
if i click on Mobile Panel, the table for freedisk also appears with message "No Result Found", and viceversa.

What i want is, on the basis of click, i want to toggle between the tables.

0 Karma
Get Updates on the Splunk Community!

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Get Inspired! We’ve Got Validation that Your Hard Work is Paying Off

We love our Splunk Community and want you to feel inspired by all your hard work! Eric Fusilero, our VP of ...