Dashboards & Visualizations

How to set a dependent Y-Axis max value depending on the selected $click.value2$?

elomotanpru
Path Finder

Hi everyone,

Would anyone know a way to make it possible for my Y-Axis highest value to change depending on the $click.value2$.

For context below are some screenshots of the dashboard that I am working on for my team. What it aims to do are the following:

  1. Display three (3) different reports by setting the following:
    1. Select a report to view via "Select to View" then click "Submit" 
      1. The default date would be used in the "From MM/DD/YYYY" and "To MM/DD/YYYY" text input. User will have to edit the date in them to adjust the time period.
    2. Proceed to the panel on the left where they must click one of the values($click.value2$) which will then generate the Area Chart on the right panel.

elomotanpru_0-1651860015614.png

My current dilemma is that each specific report has its own "Max Y-Axis Value".

Is there a way for me to set that without using "Chart Overlay" so that it would be easier for our business unit to understand it. Preferably using XML or any default Splunk features (version 8.1.3).

Thank you.

Labels (3)
Tags (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You should be able to use the change handler (<change> block) of the existing dropdown to set the appropriate max value token based on the selection

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try setting the max based on a token and set the token in the drilldown.

0 Karma

elomotanpru
Path Finder

Would I need to make a whole new dropdown for this? That was something I tried but I was hoping there was a way to reduce the number of inputs our users would be clicking.

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You should be able to use the change handler (<change> block) of the existing dropdown to set the appropriate max value token based on the selection

elomotanpru
Path Finder

Was able to make my event handler work after watching some Youtube videos about it. Thanks for the suggestion

0 Karma

elomotanpru
Path Finder

Not that familiar on how to set it. This is what I came up with but I was unable to set it up properly:

<form theme="dark">
  <label>CSC/ERSC/PSI_MSTOR Report</label>
  <fieldset submitButton="true" autoRun="false">
    <input type="dropdown" token="select">
      <label>Select to View</label>
      <choice value="*-------*">*-------*</choice>
      <choice value="D7X0">D7X0</choice>
      <choice value="H7X0">H7X0</choice>
      <choice value="D1D0">D1D0</choice>
      <choice value="DAD0">DAD0</choice>
      <choice value="E1D0">E1D0</choice>
      <choice value="H1D0">H1D0</choice>
      <choice value="WSYS">WSYS</choice>
      <choice value="YSYS">YSYS</choice>
      <default>*-------*</default>
    </input>
    <input type="text" token="from">
      <label>From MM/DD/YYYY</label>
      <default>03/01/2022</default>
    </input>
    <input type="text" token="to">
      <label>To MM/DD/YYYY</label>
      <default>03/31/2022</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <title>Check select ($select$) from dropdown. Check max ($max$) as hidden value</title>
      <chart>
        <title>Area Chart - $select$ $from$ - $to$</title>
        <search>
          <query>index=mainframe-platform 
sourcetype="mainframe:mstor" 
MVS_SYSTEM_ID=$select$
| eval DATE=strftime(strptime(DATE,"%d%b%Y"),"%Y-%m-%d")
| eval _time=strptime(DATE." ","%Y-%m-%d")
| where _time &gt;= strptime("$from$", "%m/%d/%Y") AND _time &lt;= strptime("$to$", "%m/%d/%Y")
| chart avg(CSAVG_AVAIL_MB) as "CSAVG_AVAIL_MB: $select$" first(CSMIN_AVAIL_MB) as "CSMIN_AVAIL_MB: $select$" over HOUR</query>
          <earliest>0</earliest>
          <latest></latest>
        </search>
        <option name="charting.axisLabelsY.majorUnit">3000</option>
        <option name="charting.axisLabelsY2.majorUnit">2000</option>
        <option name="charting.axisTitleY2.text">CSMIN_AVAIL_MB: $lpar$</option>
        <option name="charting.axisY.maximumNumber">$max$</option>
        <option name="charting.axisY.minimumNumber">3000</option>
        <option name="charting.axisY.scale">linear</option>
        <option name="charting.axisY2.enabled">0</option>
        <option name="charting.axisY2.maximumNumber">$max$</option>
        <option name="charting.axisY2.minimumNumber">0</option>
        <option name="charting.axisY2.scale">linear</option>
        <option name="charting.chart">area</option>
        <option name="charting.chart.overlayFields">"CSAVG_AVAIL_MB: E1D0","CSAVG_AVAIL_MB: D1D0","CSAVG_AVAIL_MB: DAD0","CSAVG_AVAIL_MB: H1D0","CSAVG_AVAIL_MB: H7X0","CSAVG_AVAIL_MB: D7X0","CSAVG_AVAIL_MB: WSYS","CSAVG_AVAIL_MB: XSYS"</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.legend.placement">top</option>
        <option name="charting.seriesColors">[DA171E,E6FFFF]</option>
        <option name="height">617</option>
        <option name="refresh.display">progressbar</option>
      </chart>
    </panel>
  </row>
0 Karma

elomotanpru
Path Finder
        <condition label="D7X0">
          <set token="max">118784</set>
        </condition>
        <condition label="H7X0">
          <set token="max">106496</set>
        </condition>
        <condition label="D1D0">
          <set token="max">67584</set>
        </condition>
        <condition label="DAD0">
          <set token="max">48128</set>
        </condition>
        <condition label="E1D0">
          <set token="max">65536</set>
        </condition>
        <condition label="H1D0">
          <set token="max">86016</set>
        </condition>
        <condition label="WSYS">
          <set token="max">32768</set>
        </condition>
        <condition label="XSYS">
          <set token="max">32768</set>

I accidentally removed this from the code above. It is supposed to go after the first input.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...