ElementStacks
by koh_edwin
HTML
<script src="http://highcharts.com/js/testing.js"></script>
<div id="container" style="height: 400px"></div>
<button>move</button>
JavaScript
window.chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
//xAxis: {
// plotBands: [{ // mark the weekend
// color: '#FCFFC5',
// from: Date.UTC(2010, 0, 2),
// to: Date.UTC(2010, 0, 4)
// }]
//},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4],
pointStart: Date.UTC(2010, 0, 1),
pointInterval: 24 * 3600 * 1000
}]
},
function(chart) {
$('button').click(function(){
var axis = chart.xAxis[0],
band = axis.plotLinesAndBands[0].options;
band.from = Date.UTC(2010, 0, 6);
band.to = Date.UTC(2010, 0, 8);
axis.isDirty = true;
chart.redraw();
});
}
);