ElementStacks
HTML
<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 400px; width: 500px"></div>
JavaScript
window.chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
xAxis: {
plotBands: [{ // mark the weekend
id: 'band1',
color: '#4572A7',
from: 100,
to: 200
},{ // mark the weekend
id: 'band2',
color: '#AA4643',
from: 200,
to: 250
}]
},
series: [
{events: {
legendItemClick: function(event) {
var serie = this,
chart = serie.chart;
chart.xAxis[0].plotLinesAndBands[serie.index].svgElem[serie.visible ? 'hide' : 'show']();
alert(this.visible);
}
},
data: [{y:29.9, x:71.5}, {y:106.4, x:129.2},{y: 144.0, x:176.0},{y: 135.6,x: 148.5}]
},
{
data: [{y:50, x:80}, {y:110, x:200},{y: 160, x:250},{y: 200,x: 250}]
}
]
});