ElementStacks
HTML
<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 300px"></div>
<script src="http://code.highcharts.com/highcharts.src.js"></script>
<button id="b1">1st series to front</button>
<button id="b2">2nd series to front</button>
JavaScript
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
borderWidth: 1,
plotBorderWidth: 1,
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
type: 'column',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
},{
data: [ 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4,22]
}]
});
$('#b1').click(function(){
chart.series[0].update({
zIndex: 10
}, false);
chart.series[1].update({
zIndex: 1
}, true);
});
$('#b2').click(function(){
chart.series[0].update({
zIndex: 1
}, false);
chart.series[1].update({
zIndex: 10
}, true);
});
});