How can I change the colors of my highcharts piechart? How can I change the colors of my highcharts piechart? javascript javascript

How can I change the colors of my highcharts piechart?


Highcharts.setOptions({ colors: ['#50B432', '#ED561B', '#DDDF00', '#24CBE5', '#64E572', '#FF9655', '#FFF263', '#6AF9C4']});

Look the following examplehttp://jsfiddle.net/8QufV/


For those of you that prefer to initialize the color in the configs, you could simply put the colors in the plotOptions portion of the config object like so:

...,plotOptions: {  pie: {   colors: [     '#50B432',      '#ED561B',      '#DDDF00',      '#24CBE5',      '#64E572',      '#FF9655',      '#FFF263',      '#6AF9C4'   ],   allowPointSelect: true,   cursor: 'pointer',   dataLabels: {     enabled: false   },   showInLegend: true }},...


I think what you need to do is set the colors using theme instead of setOptions as follows:

Highcharts.theme = {colors: ['#50B432', '#ED561B', '#DDDF00', '#24CBE5',                              '#64E572', '#FF9655', '#FFF263', '#6AF9C4']});