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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

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