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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...