benjaminz
benjaminz

Reputation: 3228

Highcharts (Highstock) how to manually set the navigator selected range

I wanted to only change the Navigator's selected area's range (and/or start and end position of the handles), but all I've got from the official doc is to do:

chart.xAxis[1].setExtremes(min, max)

which changes the whole navigator's range.

Here is a fiddle to better explain my case: http://jsfiddle.net/yvw8wje4/

Any ideas how to make this possible? (if possible)

Upvotes: 3

Views: 6764

Answers (1)

JaskeyLam
JaskeyLam

Reputation: 15755

As the comment said ,you should use xAxis[0]:

chart.xAxis[0].setExtremes(min, max,[Boolean redraw], [Mixed animation]);

fiddle1

Also, you can use xAxis.range when initing your chart:

$('#container').highcharts('StockChart', {
    xAxis: {
        range: 6 * 30 * 24 * 3600 * 1000 // six months
    },
}

fiddle2

Upvotes: 11

Related Questions