Dashboards & Visualizations

SVG Custom visualization - drilldown or setting a token

tomaszwrona
Explorer

Hi all,

 

i have used the SVG Custom Visualisation to create a nice picture.

Now i would like to have a drilldown or at least a possibility to set a token, when a part of the picture is clicked on. Is there a way to achieve this? Any hint would be great.

 

Best regards

Tomasz

Labels (2)
0 Karma

tomaszwrona
Explorer

Hi all,

i did manage to answer my own question.

In order to use tokens in SVG Visualization following steps should be taken:

  1. Extend Simple XML Dashboard with Javascript
  2. Put an id on Splunk's default element, for example panel:
    <panel id="svgViz">
  3. Put an id on any SVG element you want to click on, for example g:
    <g id="myId" filter="url(#Shadow)">
  4. In Javascript get the panel:
    var my_panel = $("#svgViz");
  5. And then create onClick function to set myNewToken:
    my_panel.on("click", "#myId", function(e) {
      var default_tokens = mvc.Components.get("submitted");
      default_tokens.set("myNewToken", "value");
    });

 

Best regards

Tomasz

0 Karma
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

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 GA in US-AWS!

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