Dashboards & Visualizations

How can I use a token set by a selected radio button to set the y-axis scale in Simple XML?

lyndac
Contributor

I'd like to have a dashboard panel that provides a radio button input with options "linear" and "log". I'd like to have the y-axis scale be set based on which radio button is selected. Is this possible using Simple XML? I was imagining using something like the below, but this throws an error.

.
.
.
<input type="radio" searchWhenChanged="true"> 
    <label>Scale</label> 
    <choice value="linear">Linear</choice> 
    <choice value="log">Log</choice> 
    <change>
        <set token="scale_tok">$value$</set>
    </change>
  </input>
.
.
.
 <option name="charting.axisY.scale">$scale_tok$</option>
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Something like this should work.

<form>
  <label>.........</label>
  <description>....</description>
  <fieldset submitButton="false" autoRun="true">
    <input type="dropdown" token="scale" searchWhenChanged="true">
      <label>Chart Scale</label>
      <choice value="linear">Linear</choice>
      <choice value="log">Log</choice>
      <default>log</default>
    </input>   
  </fieldset>
    <row>
    <panel>
      <chart>
        <title>Dispenser Status by Country</title>
    <search base="BaseOps"> 
    <query>......... </query>
    </search>   
        <option name="charting.drilldown">all</option>
    ......
     <option name="charting.axisY.scale">$scale$</option>
    .......
      </chart>
    </panel>   
  </row>
</form>

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Something like this should work.

<form>
  <label>.........</label>
  <description>....</description>
  <fieldset submitButton="false" autoRun="true">
    <input type="dropdown" token="scale" searchWhenChanged="true">
      <label>Chart Scale</label>
      <choice value="linear">Linear</choice>
      <choice value="log">Log</choice>
      <default>log</default>
    </input>   
  </fieldset>
    <row>
    <panel>
      <chart>
        <title>Dispenser Status by Country</title>
    <search base="BaseOps"> 
    <query>......... </query>
    </search>   
        <option name="charting.drilldown">all</option>
    ......
     <option name="charting.axisY.scale">$scale$</option>
    .......
      </chart>
    </panel>   
  </row>
</form>
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 ...