How to have each bar in a Bar chart a different color/gradient

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Tim on 3rd April 2013
If I have a simple bar chart with three data values (e.g., var data = [ 14.3, 5.9, 13.2 ] ), how can I get each bar to be a different color/gradient?

I know that pairs of data values (e.g., var data = [ [ 3, 14.3 ], [ 8, 5.9 ], [ 3, 13.2 ] ] ) can, by setting two colors (e.g., bar.Set('chart.colors', ['green','blue']); ) be rendered with different colors or gradients for the 1st and 2nd bar in each pair, but that is not what I want.

Thanks in advance,

Tim
Posted by RGraph support on 4th April 2013
Hi there,

You can set the colors that you want to use with chart.colors and also set chart.colors.sequential to true.

PS Could you link to the RGraph website - thanks.

Richard, RGraph Support

1 Year Priority Support now reduced to £299:
   www.rgraph.net/support

Add a reply




« Back to message list