All Apps and Add-ons

Javascrip for custom viz

Bentash
Explorer

part of xml
alt text

javascript for drill down:

// Components to require
var components = [
"splunkjs/ready!",
"splunkjs/mvc/simplexml/ready!",
"jquery",
];

// Require the components
require(components, function(
mvc,
ignored,
$
) {
$('#vizid1').click(function() {
window.open(
'dashbord_here',
'_blank' // <- This is what makes it open in a new window.
);
});
});

How do i call the viz id instead because i have an image sitting on my panel and when i call panel id, everywhere in the panel is clickable. I want just the viz id, to be clickable.

Thanks

0 Karma
1 Solution

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @Bentash,

Can you please try @niketnilay's post in below link?

https://answers.splunk.com/answers/525125/water-gauge-visualization-drilldown.html

Thanks

View solution in original post

0 Karma

ips_mandar
Builder

@Bentash ,
I tried it with html tag in panel and it works as expected ..try below-
xml-

<dashboard script="water_gauge_drilldown.js">
  <label>WaterGauge</label>
  <row>
    <panel id="panel1">
      <html>
        <div class="div_class1"> 
          <div class="image"/>
        </div>
      </html>
      <viz id="waterGauge1" type="cuviz_water_gauge.water_gauge">
        <search>
          <query>index=_internal| timechart count by source</query>
          <earliest>-15m</earliest>
          <latest>now</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="drilldown">none</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.scales.shared">1</option>
        <option name="trellis.size">medium</option>
      </viz>
    </panel>
  </row>
</dashboard>

water_gauge_drilldown.js-

var components = [
      "splunkjs/ready!",
      "splunkjs/mvc/simplexml/ready!",
      "jquery"
  ];

  // Require the components
  require(components, function(
      mvc,
      ignored,
      $
  ) {
   $('#waterGauge1').click(function() {
        window.open(
                    'https://answers.splunk.com',
                    '_blank' // <- Open target in a new window.
                  );
      });
  });

After this you may need to restart / bump verison

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

HI @Bentash,

Can you please try @niketnilay's post in below link?

https://answers.splunk.com/answers/525125/water-gauge-visualization-drilldown.html

Thanks

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 ...