I'm using a range selector in my dynamic updating chart. I just discovered that on each chart redraw (to populate new values), the selected value in range option is not retained. How can I accomplish this?
My Range Selector:
rangeSelector: {
buttons: [{
count: 1,
type: 'minute',
text: '1M'
},{
count: 60,
type: 'minute',
text: '1H'
}, {
count: 4,
type: 'hour',
text: '4H'
}, {
count: 8,
type: 'hour',
text: '8H'
}, {
count: 1,
type: 'day',
text: '1D'
}, {
count: 7,
type: 'day',
text: '7D'
}, {
type: 'all',
text: 'All'
}],
inputEnabled: false,
selected: 0
},
The event that redraws the chart with new data
events: {
load: function () {
// set up the updating of the chart each second
var
_seriesIMP = this.series[0],
_seriesREP = this.series[1],
_seriesANA = this.series[2];
setInterval(function () {
var x = (new Date()).getTime(), // current time
r = _yValue(),
y = new Array(3);
if (r.length == 0) {
y[0] = 0;
y[1] = 0;
y[2] = 0;
}
else {
y = r.split(',');
}
_seriesIMP.addPoint([x, y[0]], false, true);
_seriesREP.addPoint([x, y[1]], false, true);
_seriesANA.addPoint([x, y[2]], false, true);
chart.redraw();
}, 60000);
}
}
},