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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...