Dashboards & Visualizations

Is there a way to specify Shared option fieldColors on every chart?

mxh7777
Path Finder

Hi,

I work on a dashboard with several charts.

All these charts use the same customized fieldColors option but I have to repeat the option charting.fieldColors in each chart.

Question : 

Is there a way to specify the option just one time and reuse it in each chart ?

Thank you

Labels (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Store the field colours in a token (in the init block) and use the token in the fieldColors option.

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Store the field colours in a token (in the init block) and use the token in the fieldColors option.

0 Karma

mxh7777
Path Finder

Hi @ITWhisperer 

Thanks for reply.

However, I try this but it doesn't work

<form>
<init>
    <set token="colorGreen">0x00AA00</set>
</init>
...
...
...
  <row>
    <panel>
      <chart>
        <option name="charting.fieldColors">{"SUCCES": $colorGreen$, "ERR. FONC.": 0x0000AA, "ERR. TECH.": 0xDD0000}</option>
...
...

My SUCCES bar still appears in Black instrad of green.

If I replace the token by his value (0x00AA00), it's OK

Is my <init> block in good location ?

Thanks

 

Tags (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Tokens aren't evaluated in edit mode - have you saved your changes?

0 Karma

mxh7777
Path Finder

Hi @ITWhisperer 

It works perfectly

Thanks a lot

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

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

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...