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!

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