Splunk Search

How to change the range of colors for D3 Chart?

shariinPH
Contributor

Hi Splunkers!

Anyone here who knows how to change the range of colors for D3 Chart?

Hope someone can help us with this.

Thanks!

1 Solution

shariinPH
Contributor

we already figured out how to change the color range of the d3charts
from the default code:

color(d3.scale.category10().range());

change the code to your desired color combinations

color(d3.scale.ordinal().range(["hexcolor1", "hexcolor2", "hexcolor3", "hexcolor4", "hexcolor5", "hexcolor6", "hexcolor7"]).range());

hope this might help! 🙂

Cheers,
shariinPH

View solution in original post

shariinPH
Contributor

we already figured out how to change the color range of the d3charts
from the default code:

color(d3.scale.category10().range());

change the code to your desired color combinations

color(d3.scale.ordinal().range(["hexcolor1", "hexcolor2", "hexcolor3", "hexcolor4", "hexcolor5", "hexcolor6", "hexcolor7"]).range());

hope this might help! 🙂

Cheers,
shariinPH

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...