Amit
Amit

Reputation: 181

Highstock chart not zooming to specific date range

I am trying to zoom highstock chart on demand but for some reason its not zooming. I am using -

chart.xAxis[0].update({min:minDate, max:maxDate});

Here is a fiddle which I have created to explain the issue. On click of 'zoom' button the chart (navigator) should zoom to the date range I have specified.

http://jsfiddle.net/amit657/0xthLnkp/1/

Appreciate if anybody can help.

Upvotes: 0

Views: 435

Answers (1)

Halvor Holsten Strand
Halvor Holsten Strand

Reputation: 20536

Instead of using the update function you should use the setExtremes (API) function of the axis.

For example:

chart.xAxis[0].setExtremes(minDate, maxDate);

See this updated JSFiddle demonstration.

Upvotes: 1

Related Questions