开发者

g.Raphael bar chart changing default color

开发者 https://www.devze.com 2023-03-23 04:10 出处:网络
Does any one know if there is a way to give assign colors to the g.Raphael Bar Chat? Have 2 bars, and 开发者_C百科really need to change the green.With the colors option:

Does any one know if there is a way to give assign colors to the g.Raphael Bar Chat?

Have 2 bars, and 开发者_C百科really need to change the green.


With the colors option:

var r = Raphael("holder");
r.g.barchart(10, 10, 300, 220, [[55, 20, 13, 32, 5, 1, 2, 10],[17,13,3,5,7,45,2,0]], {colors:["#FF0000","#006699"]});

You can copy/paste this code into your console on this page: http://g.raphaeljs.com/barchart.html to see what I mean.

https://github.com/DmitryBaranovskiy/g.raphael/blob/master/g.bar.js


try using attr:

r.barchart(0, 20, 1000, 580, values).attr({fill: "#333399"});
0

精彩评论

暂无评论...
验证码 换一张
取 消