Dashboards & Visualizations

How to make label and dropdown in the same line on a dashboard?

paigeliao
New Member

In dashboard when add an dropdown input, label and dropdown are look lile below, is that any way to make label and dropdown in the same line on a dashboard?
alt text

0 Karma

niketn
Legend

@paigeliao try the following run anywhere example and confirm if that is what is required.

<form>
  <label>Display Label and Time Dropdown in the same line</label>
  <fieldset submitButton="false">
  </fieldset>
  <row>
    <panel>
      <input id="my_date_range" type="time" token="tokDateRange" searchWhenChanged="true">
        <label>Date Range</label>
        <default>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </default>
      </input>
      <html depends="$alwaysHideCSSPanel$">
        <style>
          #my_date_range{
            display:flex !important;
          }
          #my_date_range label{
            padding-right: 10px;
            padding-top: 5px;
          }
        </style>
      </html>
    </panel>
  </row>
</form>

PS: I have moved Time Picker input inside a panel but that is not mandatory. What is required is to add id to the input and use correct CSS selector to bring lable and dropdown in the same line with padding.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...