Question

Does anyone know how to create custom colors on a d3 treemap without using color2 = d3.scale.category20c(); or d3.scale.category10c();?

Thanks so much if you do.

Was it helpful?

Solution

category10() is just a special ordinal scale. You can make another with your own colors:

color = d3.scaleOrdinal().range(['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd'])
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top