Fine grained control over colors in stacked Bar chart?

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 Todd Hoffman on 11th June 2013
I'd like to get fine grained control of the colors in a stacked bar chart. My data is an array of arrays, and I'd like to be able to control the color of each bar. So, I'd like to be able to do something like this:

             var bar = new RGraph.Bar('cvs', [[1,1,1,1,1,1,1,1,1,0],[1,1,1,1,1,1,1,1.5],[1,1,1,1,1,2.5],[1,1,1,3.5],[1,4.5]])
     .Set('labels', ['Phase 1','Phase 2','Phase 3','Registered','Launched'])
                 .Set('colors', [['blue','blue','blue','blue','blue','blue','blue','blue','blue','blue','white'],['blue','blue','blue','blue','blue','blue','blue','white'],['blue','blue','blue','blue','blue','white'],['blue','blue','blue','white'],['blue','white']])
                 .Set('grouping', 'stacked')

It seems like passing in an array of arrays of colors should work, but I just get all black on the graph. Is this possible?
Posted by RGraph support on 11th June 2013
Hi there,

You can use the chart.colors.sequential option. Like this example:

Richard, RGraph Support

5 developer license with Priority support for £299:

Add a reply

« Back to message list