答案 0 :(得分:3)
@Tkingovr chart_color适用于所有图表,但是一维。您可以将shade_color用于一维图表https://github.com/pykih/PykCharts.js/wiki/Colors#shade-color
@KIRANJOSHI
var selector = "pieContainer", // selector of your chart
colors = ["red","blue","green","yellow","orange"];
setTimeout(function() {
d3.selectAll("#" + selector + "_svg path.pie")
.attr("fill",function(d, i) {
return colors[i];
});
},1000);
setTimeout是必需的,因为图表可能需要一些时间来呈现,并且当前版本中没有规定在图表渲染完成时运行一段代码。
答案 1 :(得分:0)
根据文档,您应该能够传递如下值:
{
"chart_color": ["blue","green","Yellow"]
}
该图表还接受以下任何一项:
Color Names (Eg: "red")
Hex values (Eg: "#B0171F")
RGB values (Eg: "rgb(176,23,31)" )