2011-07-27 3 views

Répondre

9

Avec l'option couleurs:

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"]}); 

Vous pouvez copier/coller ce code dans votre console sur cette page: http://g.raphaeljs.com/barchart.html pour voir ce que je veux dire.

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

+0

Vous pouvez également utiliser rgb et rgba. par exemple. 'colors: [" rgb (255,153,0) "," rgba (255,153,0,0.5) "]' –

2

essayer d'utiliser attr:

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

FONCTIONNE PARFAIT !!!! .. –

Questions connexes