Chart only uses the first color from the colors property

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Diana Perez on 1st September 2015
Hello everyone,

I don't now to put a color specific to the lines, in the moment I have this code, but the Bar is together:

My code:

  var bar1 = new RGraph.Bar('cvs_bar', [[d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16,d17,d18,d19,d20,d21]])
                   .set('colors', [['#0174DF'],['#0174DF'],['#0174DF'],['#0174DF'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#FF8000'], ['#FF8000'], ['#01DFD7'], ['#FA5858'], ['#00FF00']])

is OK!

But I want...

  var bar1 = new RGraph.Bar('cvs_bar', [[d1],[d2],[d3],[d4,[d5],[d6],[d7],[d8],[d9],[d10],[d11],[d12],[d13],[d14],[d15],[d16],[d17],[d18],[d19],[d20],[d21]])
                  
.set('colors', [['#0174DF'],['#0174DF'],['#0174DF'],['#0174DF'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#873792'], ['#FF8000'], ['#FF8000'], ['#01DFD7'], ['#FA5858'], ['#00FF00']])


but only just take the first color
Posted by Richard Heyes on 1st September 2015
Hi there,

Have you tried setting the colors.sequential option to true?

bar1.set('colors.sequential', true);



Richard

Add a reply




« Back to message list