João Martins
João Martins

Reputation: 1046

Highcharts-ng reset zoom

I have this problem using highcharts-ng: when I try to push a new data series over an existing data series already in a chart, the new series will be zoomed with the old zoom. My question is: is there any way to zoom to the default value of the new series after it's loaded?

$scope.datChart.series.pop();    
$scope.datChart.series.push({data:dataArray, name:'Total'});
//$scope.datChart zoom out to default value of the new series

PS: the function zoomOut() doesn't work with highcharts-ng.

Thanks anyways

Upvotes: 1

Views: 1290

Answers (1)

Hasan Rahal
Hasan Rahal

Reputation: 153

I faced the same problem. I found a way around by setting:

$scope.chart.xAxis.min = xMinValue; 
$scope.chart.xAxis.max = xMaxValue;
$scope.chart.xAxis.currentMin =  xMinValue; 
$scope.chart.xAxis.currentMax = xMaxValue;

so every time you push new data, you do it by updating these $scopes as well

Upvotes: 1

Related Questions