Splunk Search

How to dynamically change background color of pie based on drop-down selection?

danliu
Loves-to-Learn Lots

Hi.
How can I change the background color of pie dynamically through drop-down selection ?
Is it okay to look like this in the picture below?

<form theme="dark">
  <label>Test2</label>
  <fieldset submitButton="false" autoRun="true"></fieldset>
  <row>
    <panel>
      <input type="dropdown" token="color_select">
        <label>Background</label>
        <choice value="#175565">Color1</choice>
        <choice value="#475565">Color2</choice>
      </input>
      <chart>
        <search>
          <query>index=p1991_m_tiltline_index_json_raw
| top vin.number</query>
          <earliest>-24h@h</earliest>
          <latest>now</latest>
        </search>
        <option name="charting.axisTitleX.visibility">visible</option>
        <option name="charting.axisTitleY.visibility">visible</option>
        <option name="charting.axisTitleY2.visibility">visible</option>
        <option name="charting.backgroundColor">$color_selectiono$</option>
        <option name="charting.chart">pie</option>
        <option name="charting.drilldown">none</option>
        <option name="charting.fontColor">#99CCFF</option>
        <option name="charting.foregroundColor">#EBF5FF</option>
        <option name="charting.legend.placement">right</option>
        <option name="charting.seriesColors">[0xEBF0F5,0xC2D1E0,0x99B2CC,0x7094B8,0x4775A3,0x2E5C8A,0x24476B,0x1A334C,0x0F1F2E,0x050A0F]</option>
        <option name="trellis.enabled">0</option>
        <option name="trellis.size">large</option>
        <option name="height">300</option>
      </chart>
    </panel>

Capture.JPG

Labels (1)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

Yes, that technique works - are you saying it doesn't?

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If this doesn't work, you could try using CSS with the token value

0 Karma

danliu
Loves-to-Learn Lots

Thank you, but I'm not very good at using CSS, could you give me a example base on my question?

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

If it works then it is OK

0 Karma
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 at Splunk .conf24 ...

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