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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...