It is currently Fri Apr 18, 2014 10:09 am Advanced search

RangeSelector Not Retaining Value on chart redraw

Technical support for the Highcharts Stock package

RangeSelector Not Retaining Value on chart redraw

Postby MacAddict » Wed Feb 22, 2012 6:10 pm

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);
}
}
},
MacAddict
 
Posts: 3
Joined: Mon Nov 21, 2011 5:38 pm

Re: RangeSelector Not Retaining Value on chart redraw

Postby hfrntt » Sun Feb 26, 2012 9:40 pm

I suppose that it's not possible to do now. I reported an issue here: https://github.com/highslide-software/h ... issues/785
Slawek Kolodziej
Highcharts support team
hfrntt
 
Posts: 6394
Joined: Mon Aug 30, 2010 10:41 am


Return to Highstock Usage

Who is online

Users browsing this forum: No registered users and 3 guests