Splunk Search

Is it possible to change default colors for charts?

dominiquevocat
SplunkTrust
SplunkTrust

Is it possible to change the default colors for charts (seriesColors), preferably so that it survives an upgrade?

I would like to use the colors in the CI for the charts be default ( as far as it goes, not that many colors 🙂 )

0 Karma

danielsachse
Loves-to-Learn

You can use an undocumented setting in ui-prefs.conf:

 

[default]
display.visualizations.charting.seriesColors = [0xea1b0a,0x1ea2b1,0xb00402,<ADD YOUR COLORS>]

 


It just didn't work as embedded report. Everywhere else - it looks fine.

If you need to set the seriesColors for a specific embedded report - you can add the property in the stanza of the report in the savedsearches.conf:

[myreport]
display.visualizations.charting.seriesColors = [0xea1b0a,0x1ea2b1,0xb00402,<ADD YOUR COLORS>]
0 Karma

marina_rovira
Contributor

Hello!
Since any answer is accepted, does it mean that is not possible to change the default array with the color I want?

I would like to make the graphs in my dashboard more unified with the company official colors, but not having to change it for every chart.

Thank you in advance.

0 Karma

aaraneta_splunk
Splunk Employee
Splunk Employee

@dominiquevocat - Did one of the answers below help provide a solution your question? If yes, please click “Accept” below the best answer to resolve this post and upvote anything that was helpful. If no, please leave a comment with more feedback. Thanks.

0 Karma

jkat54
SplunkTrust
SplunkTrust
0 Karma

dominiquevocat
SplunkTrust
SplunkTrust

to make it more precise: i would like to change the default stylesheet or something i.e. influence the colors Splunk uses unless you specify something in the xml of a dashboard etc.

0 Karma

srinivasup
Explorer

{"Error": 0xFF0000,"Success":0x00FF00}

0 Karma

niketn
Legend

You can use either or both for fieldColors and seriesColors with your set of colors to be consistent across your app.


[Update]

Following are built in Chart Coloring options (Refer to Chart Color Options in Splunk 6.x Dashboard Examples app)

<option name="charting.backgroundColor">
<option name="charting.foregroundColor">
<option name="charting.fontColor">
<option name="charting.seriesColors">

You can use CSS to override styling as per your need as well. You can override svg segments using !important in CSS. (Refer to Custom Layout Example: Dark example in Splunk 6.x Dashboard Examples App.

/* SVG */
.highcharts-container svg {
    background: #000;
}
.highcharts-container svg>rect:not(.block-background) {
    fill: #000 !important;
    opacity: 0.1;
}
.highcharts-container svg text:not(.single-result):not(.delta-label) {
    fill: #ccc !important;
}
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

felipesewaybric
Contributor

And you can use in the options xml, like this:

{"field1":#23B5F9, "field2":#FB8900, "field3":#FF5733, "field4":#14B87C}

0 Karma

mhassan24
Explorer

Yes, there is.
You have the option of deliberately assigning colors to series (in order) rather than allowing Splunk to go with default on dashboards:
http://docs.splunk.com/Documentation/Splunk/6.2.4/Viz/Chartcustomization

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...