Other Usage

How to change treemap default colors for categorical colorMode?

connect
Engager

I am using treemap visualization. I have been trying to change the default color of the treemap using the following options:

<option name="treemap_app.treemap.maxColor">
<option name="treemap_app.treemap.minColor">

colorMode has been set to categorical

<option name="treemap_app.treemap.colorMode">categorical</option>

treemap doesn't seem to honor any changes to maxColor or minColor and uses the default colors.

Is this a bug in treemap?

 

maxColor/minColor seems to work if colorMode is changed is sequential but that is not the view I'm interested in

 

 

Tags (1)
0 Karma

tscroggins
Influencer

Hi,

Documentation is no longer linked on Splunkbase, but it's still available here: https://docs.splunk.com/Documentation/Treemap/1.5.0/TreemapViz/TreeMapFormat 

Minimum and maximum color values are only used in sequential mode.

In categorical mode, Treemap uses a default palette provided by Splunk:

 

ColorCodes.CATEGORICAL = [
    "#7b56db", "#cb2196", "#008c80", "#9d6300", "#f6540b", "#ff969e", "#99b100", "#f4b649", "#ae8cff", "#8cbcff",
    "#813193", "#0051b5", "#009ceb", "#00cdaf", "#00490a", "#dd9900", "#465d00", "#ff677b", "#ff6ace", "#00689d"
];

ColorCodes.CATEGORICAL_DARK = ColorCodes.CATEGORICAL; // @pwied: for now we use the same colors in dark mode

 

When useColors is false, Treemap defaults to this shade of blue: #1e93c6.

0 Karma

connect
Engager

Thank you @tscroggins  Is there any recommended way to change the defaults values for

ColorCodes.CATEGORICAL

 and have changes be limited to treemap visuals?

0 Karma

tscroggins
Influencer

There isn't a simple way, but if you're feeling adventurous, you can unminify and edit $SPLUNK_HOME/etc/apps/treemap_app/appserver/static/visualizations/treemap/visualization.js. You'll lose Splunk support, but any changes you make could be submitted to Splunk as ideas or feature enhancement requests.

Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...
OSZAR »