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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...