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.

有帮助吗?

解决方案

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

color = d3.scaleOrdinal().range(['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd'])
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top