Dashboards & Visualizations

Bar chart color customization - change the color based on count value in series?

Nadhiya123
Explorer

Please help me out here .

I am trying to customize the bar chart color when using the stats command .

my SPL |stats count by CODE

how to set the colors dynamically for the count value in the series .

i have tried [0xe60026,0xffd700,0x66CC66] .its not helping .

jincy_18
Path Finder
0 Karma

niketn
Legend

@Nadhiya123, can you please provide your Simple XML Chart configuration where you have applied the above?

Do you have the values of CODE (i.e. Series Names) based on which you need to color? Or is it going to be dynamic based on sequence?

Similar questions have been answered in past, however, you would need to provide more details as to what specifically you need help with.

If you know the the CODE field values, you can color based on charting.fieldName option by providing specific field name (the following example sets color based on field values ERROR, WARN and INFO for CODE:

    <option name="charting.fieldColors">
      {"ERROR": 0xFF0000, "WARN": 0xFF9900, "INFO":0x0066FF}
    </option>

If you know the sequence of the field and not the names, you can try the charting.seriesColors:

    <option name="charting.seriesColors">
      [0xFF0000,0xFF9900,0x0066FF]
    </option>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

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