Dashboards & Visualizations

Can I allow a user to change visualizations in a dashboard?

feickertmd
Communicator

I have a timechart that could make sense in a number of different visualizations. Is there a way to create the dashboard panel and add a control so that the person reading the dashboard can change the visualization? I can do it in the editor, but I want something available to the user lets you toggle between "line" and "bar".

0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

You can create a radio button with the options and use that token in your dashboard xml for chart type (need to edit xml)

See this run anywhere sample

<form>
  <label>Dynamic Chart Type</label>
  <fieldset submitButton="false">
    <input type="radio" token="charttype">
      <label>Chart Type</label>
      <choice value="line">Line</choice>
      <choice value="column">Column</choice>
      <choice value="area">Area</choice>
      <default>column</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal | timechart count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.chart">$charttype$</option>       
      </chart>
    </panel>
  </row>
</form>

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

You can create a radio button with the options and use that token in your dashboard xml for chart type (need to edit xml)

See this run anywhere sample

<form>
  <label>Dynamic Chart Type</label>
  <fieldset submitButton="false">
    <input type="radio" token="charttype">
      <label>Chart Type</label>
      <choice value="line">Line</choice>
      <choice value="column">Column</choice>
      <choice value="area">Area</choice>
      <default>column</default>
    </input>
  </fieldset>
  <row>
    <panel>
      <chart>
        <search>
          <query>index=_internal | timechart count</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.chart">$charttype$</option>       
      </chart>
    </panel>
  </row>
</form>

idanshaanan
New Member

I did the exactly like the example but still get the error "No matching visualization found", someone know why?

0 Karma

qiuyongjie
New Member

Hi @somesoni2 , I just use the sample but got error "No matching visualization found", do you know the reason?

0 Karma

feickertmd
Communicator

Perfect! Thanks very much

0 Karma

kollachandra
Path Finder

How to use table also as one of the types to these visualizations?

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Best method for that would be use a post process implementation with one panel with fixed type as table and other using radio button option. This way you'd run the search just once but populate two visualization with it. See this for more information and example.
http://docs.splunk.com/Documentation/Splunk/7.0.2/Viz/Savedsearches#Post-process_searches_2

0 Karma

kollachandra
Path Finder

It helped partially for my requirement. But thank you very much for the input.

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