Is there a way to control the order in which new series are added to a stacked column chart in Highcharts? Currently, using addSeries places the new series at the bottom of the stack. Here's a simplified example of what I'm working on:
var chart = new Highcharts.Chart({
chart: {
type: 'column',
renderTo: 'container'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar']
},
plotOptions: {
series: {
stacking: 'normal'
}
},
series: [{
name: 'base',
data: [10, 20, 30]
}, {
name: 'sec',
data: [30, 20, 10]
}]
});
var i = 0;
$('#add').on('click', function (e) {
chart.addSeries({
data: [32, 43, 42],
name: ++i,
index: 0 //??????
});
});
Here's a fiddle demonstrating this issue: http://jsfiddle.net/6bCBf/
Does anyone have any suggestions for reversing or controlling where the new series is inserted by Highcharts?
I've attempted setting the index of the new series to 0 without success. Setting it to -1 adds the series to the bottom of the array, but then the "stacking" functionality doesn't work as intended.