Javascript / 调整颜色

Javascript / Adjusting colors

我们正在使用这个 chart。我看到没有 属性 可用于自定义饼图的颜色。

自定义颜色有两种方式

1) 使用 colorField 并直接为各个切片定义颜色。

2) 通过修改colors array or create your own theme.

设置自己的主题

通过在图表配置中设置空图例对象启用图例。您可以找到更多配置属性 in the documentation. You can even change the value label to use percentages by modifying the valueText property. There's also an example of a pie chart with the legend set up and a completely custom legend

如果要更改饼图切片标签,请更改 labelText

至于你的最后一个问题,不 - 它使用 pulledField 来指定从你的数据中提取哪些切片。没有它就没有爆炸整个图表的设置。