set color of grouped stacked column in highcharts -


i have requirement set color of stack column chart in relation previous stack. consider fiddle. http://jsfiddle.net/0n7g4a1e/

series: [{         name: 'john',         data: [5, 3, 4, 7, 2],         stack: 'actual'     }, {         name: 'john',         data: [3, 4, 4, 2, 5],         stack: 'budget'     }] 

if jane - actual light green, jane - budget should dark green. should categories, apple through bananas. if john - acutal light blue, john - budget should dark blue.

how can done? dont want specify each point color, fine automatic color gets selected, bugdet series should have shade darker actual.

thanks.

you need set colors highcharts in way, example, basing on default colors:

var colors = highcharts.getoptions().colors.slice(0), // default colors     dark = -0.5;   colors[1] = highcharts.color(colors[0]).brighten(dark).get(); // using highcharts.color(), darker golor, using first color base  colors[3] = highcharts.color(colors[2]).brighten(dark).get(); 

now set colors:

$('#container').highcharts({      chart: {         type: 'column'     },      colors: colors, 

demo: http://jsfiddle.net/0n7g4a1e/2/


Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

ios - Realm over CoreData should I use NSFetchedResultController or a Dictionary? -

r - Update two sets of radiobuttons reactively - shiny -