Pie chart colors

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 Jan on 25th October 2013
As one of my pie charts requires more than the default 13 colors I'm passing in my own. However, something is different. The new colors fill the pie pieces solid, whereas the default colors "whiten" towards the edge of the pie. Is there a setting to enable this effect if I pass in the colors? Thanks :)
Posted by RGraph Support on 25th October 2013
Hi there,


Yes - the default colors are gradients which you can specify using the RGraph shorthand like this:

obj.Set('colors', ['Gradient(blue:#ccf)','Gradient(red:#fcc)'])


Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site
Posted by Jan on 25th October 2013
Thank you, I see. So there is no possible to just pass in normal colors and have them all being gradients towards the same color? I'm generating my JSON in PHP, so I can't use RGraph's own functions to influence the JSON.
Posted by RGraph Support on 25th October 2013
Hi there,

There's nothing in RGraph that generates a gradient from a color - but it would be easy to make your own function that takes an array of colors and returns an array of gradients.



Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site

Add a reply




« Back to message list