<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to get the on click marker gauge redirect to a dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323051#M20838</link>
    <description>&lt;P&gt;@priyanka0309, I dont think drilldown is enabled for &lt;CODE&gt;Filler&lt;/CODE&gt; or &lt;CODE&gt;Marker&lt;/CODE&gt; gauge. Since &lt;CODE&gt;Filler Gauge&lt;/CODE&gt; actually displays the statistical data on the &lt;CODE&gt;svg&lt;/CODE&gt; chart, you can use Simple XML JavaScript extension with SplunkJS stack to get the clicked value from chart and assign to token.&lt;/P&gt;

&lt;P&gt;Following is a run anywhere dashboard example with JavaScript Code.&lt;BR /&gt;
PS: CSS Style override is applied in the Simple XML code to make the cursor as pointer.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4732iAC0468E505F6B2D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="fillergauge_drilldown.js"&amp;gt;
  &amp;lt;label&amp;gt;Drilldown for Filler Gauge&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html depends="$alwaysHideCSSPanel$"&amp;gt;
        &amp;lt;style&amp;gt;
          #fillerGauge svg rect{
            cursor:pointer !important;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Filler Gauge&amp;lt;/title&amp;gt;
      &amp;lt;chart id="fillerGauge"&amp;gt;
        &amp;lt;title&amp;gt;Clicked Value : $tokValue$&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunk_web_access status=*
| stats count as Total count(eval(status!=200)) as Fail
| eval Perc=round((Fail/Total)*100,1)
| fields Perc&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;fillerGauge&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.rangeValues"&amp;gt;[0,10,20,100]&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.gaugeColors"&amp;gt;["0x84E900","0xFFE800","0xBF3030"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.mode"&amp;gt;standard&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;right&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.lineWidth"&amp;gt;2&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the corresponding JavaScript &lt;CODE&gt;fillergauge_drilldown.js&lt;/CODE&gt; required. The same needs to be placed under your Splunk App's  appserver/static folder i.e. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;yourAppName&amp;gt;/appserver/static&lt;/CODE&gt;. You might need to refresh/bump/restart Splunk and also clear internet browser history.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'jquery',
     'splunkjs/mvc',
     'splunkjs/mvc/simplexml/ready!'
 ], function($,mvc){

    var defaultTokenModel=mvc.Components.get("default");
    var submittedTokenModel=mvc.Components.get("submitted");
    $(document).on("click", "#fillerGauge svg rect", function() {
        var strValue=$("#fillerGauge svg text:last-child").text();
        if (strValue!==undefined){
            defaultTokenModel.set("tokValue",strValue);
            submittedTokenModel.set("tokValue",strValue);
            console.log("strValue:",strValue);
        }
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 09 Apr 2018 11:33:12 GMT</pubDate>
    <dc:creator>niketn</dc:creator>
    <dc:date>2018-04-09T11:33:12Z</dc:date>
    <item>
      <title>How to get the on click marker gauge redirect to a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323049#M20836</link>
      <description>&lt;P&gt;Please post the code for redirecting to a new dashboard on click of filler/marker gauge.&lt;/P&gt;

&lt;P&gt;Any help is appreciated thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 20:46:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323049#M20836</guid>
      <dc:creator>priyanka0309</dc:creator>
      <dc:date>2018-04-06T20:46:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the on click marker gauge redirect to a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323050#M20837</link>
      <description>&lt;P&gt;Hey@priyanka0309,&lt;/P&gt;

&lt;P&gt;You can refer this doc:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Define_tokens_for_conditional_operations_with_the_.3Cdrilldown.3E_element"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Viz/tokens#Define_tokens_for_conditional_operations_with_the_.3Cdrilldown.3E_element&lt;/A&gt;.&lt;BR /&gt;
 Just pass in the click.value2and the earliest/latest and I think it would work.&lt;/P&gt;

&lt;P&gt;Let me know if this helps!!&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 09:50:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323050#M20837</guid>
      <dc:creator>deepashri_123</dc:creator>
      <dc:date>2018-04-09T09:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to get the on click marker gauge redirect to a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323051#M20838</link>
      <description>&lt;P&gt;@priyanka0309, I dont think drilldown is enabled for &lt;CODE&gt;Filler&lt;/CODE&gt; or &lt;CODE&gt;Marker&lt;/CODE&gt; gauge. Since &lt;CODE&gt;Filler Gauge&lt;/CODE&gt; actually displays the statistical data on the &lt;CODE&gt;svg&lt;/CODE&gt; chart, you can use Simple XML JavaScript extension with SplunkJS stack to get the clicked value from chart and assign to token.&lt;/P&gt;

&lt;P&gt;Following is a run anywhere dashboard example with JavaScript Code.&lt;BR /&gt;
PS: CSS Style override is applied in the Simple XML code to make the cursor as pointer.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4732iAC0468E505F6B2D9/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard script="fillergauge_drilldown.js"&amp;gt;
  &amp;lt;label&amp;gt;Drilldown for Filler Gauge&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html depends="$alwaysHideCSSPanel$"&amp;gt;
        &amp;lt;style&amp;gt;
          #fillerGauge svg rect{
            cursor:pointer !important;
          }
        &amp;lt;/style&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;Filler Gauge&amp;lt;/title&amp;gt;
      &amp;lt;chart id="fillerGauge"&amp;gt;
        &amp;lt;title&amp;gt;Clicked Value : $tokValue$&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_internal sourcetype=splunk_web_access status=*
| stats count as Total count(eval(status!=200)) as Fail
| eval Perc=round((Fail/Total)*100,1)
| fields Perc&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.overflowMode"&amp;gt;ellipsisNone&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisLabelsX.majorLabelStyle.rotation"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleX.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisTitleY2.visibility"&amp;gt;visible&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisX.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY.scale"&amp;gt;linear&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.abbreviation"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.axisY2.scale"&amp;gt;inherit&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;fillerGauge&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMaximumSize"&amp;gt;50&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleMinimumSize"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.bubbleSizeBy"&amp;gt;area&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.nullValueMode"&amp;gt;gaps&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.rangeValues"&amp;gt;[0,10,20,100]&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.showDataLabels"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.sliceCollapsingThreshold"&amp;gt;0.01&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.stackMode"&amp;gt;default&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.style"&amp;gt;shiny&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;all&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.gaugeColors"&amp;gt;["0x84E900","0xFFE800","0xBF3030"]&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.layout.splitSeries.allowIndependentYRanges"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.labelStyle.overflowMode"&amp;gt;ellipsisMiddle&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.mode"&amp;gt;standard&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.legend.placement"&amp;gt;right&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.lineWidth"&amp;gt;2&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.enabled"&amp;gt;0&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.scales.shared"&amp;gt;1&amp;lt;/option&amp;gt;
        &amp;lt;option name="trellis.size"&amp;gt;medium&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Following is the corresponding JavaScript &lt;CODE&gt;fillergauge_drilldown.js&lt;/CODE&gt; required. The same needs to be placed under your Splunk App's  appserver/static folder i.e. &lt;CODE&gt;$SPLUNK_HOME/etc/apps/&amp;lt;yourAppName&amp;gt;/appserver/static&lt;/CODE&gt;. You might need to refresh/bump/restart Splunk and also clear internet browser history.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;require([
     'jquery',
     'splunkjs/mvc',
     'splunkjs/mvc/simplexml/ready!'
 ], function($,mvc){

    var defaultTokenModel=mvc.Components.get("default");
    var submittedTokenModel=mvc.Components.get("submitted");
    $(document).on("click", "#fillerGauge svg rect", function() {
        var strValue=$("#fillerGauge svg text:last-child").text();
        if (strValue!==undefined){
            defaultTokenModel.set("tokValue",strValue);
            submittedTokenModel.set("tokValue",strValue);
            console.log("strValue:",strValue);
        }
    });
});
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Apr 2018 11:33:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-the-on-click-marker-gauge-redirect-to-a-dashboard/m-p/323051#M20838</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-04-09T11:33:12Z</dc:date>
    </item>
  </channel>
</rss>

