Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有谁知道如何在不使用 color2 = d3.scale.category20c(); 的情况下在 d3 树图上创建自定义颜色?或 d3.scale.category10c();?
非常感谢,如果你这样做。
category10() 只是一个特殊的序数比例。您可以使用自己的颜色制作另一个:
color = d3.scaleOrdinal().range(['#1f77b4', '#ff7f0e', '#2ca02c', '#d62728', '#9467bd'])