How to change the colors in an RGraph Pie chart?


« 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 Leandro Medeiros on 22nd July 2015
Mister,

How can I change the pie chart colors?
I have tried to change using the "properties.colors" as below without success.

Sample:
var pie1 = new RGraph.Pie({
id: 'mapa_chuva',
data: [<?php echo $dados;?>],
properties: {
   colors: ['Gradient(#FFFF66:#CCFF66)','...',.... other colors as I need],
},
options: {
   .....
  }
}).draw()

I'll be really greatifully with your help.

Thank's a lot.

Regards,

Leandro Medeiros
SC - Brazil
Posted by Richard on 22nd July 2015
Him

Close - but instead of "properties" it should be "options":

var pie1 = new RGraph.Pie({
id: 'cvs',
data: [4,8,6,5,3],
options: {
    colors: ['Gradient(#FFFF66:#CCFF66)'],
   }
}).draw()



www.rgraph.net/fiddle/view.html/a-pie-chart-changing-the-colors



Richard

Add a reply

 




« Back to message list
RGraph on social media