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.

Était-ce utile?

La 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'])
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top