Вы можете установить параметры следующим образом:
var custom_colors =["#ff0000","#00ff00","#0000ff","#ffff00","#ff00ff","#00ffff"];
r.barchart(x,y,width,height,[data], { colors: custom_colors });
Другие опции
var options : {
legend : [],
stacked: false, //Use this to stack your bars instead of displaying them side by side
type: "soft", //round, sharp, soft, square,
colors : custom_colors
}
r.barchart(x,y,width,height,[data], options);
Возможно, вы захотите определить свои цвета в функции. Вот функция, которую вы можете использовать:
function _getColors() {
var byndColors = ["#ffc000","#1d1d1d","#e81c6e","#7c7c7c","#00aff2","#aaaaaa","#611bc9"];
//some random colors
var randColors = ["#77efac","#364f8a","#60cb94","#cf263b","#2471bb","#7fc398","#d2c66a","#2109dc","#66ad29","#9a9754","#640cdf","#257683","#d51e05","#4bb36e","#e7408a","#1ef173","#1756bc","#cff215","#15c2fb","#f010ab","#844a0","#c34021","#3e4cf2","#8e2864","#a28f5c","#a9d528","#7b1e43","#a5401c","#829813","#691ccd"]
//combine them
return byndColors.concat(randColors);
}
и используйте его как:
r.barchart(x,y,width,height,[data], { colors: _getColors() });