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’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

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

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...