Commit bb1e73dc by Torkel Odegaard

fixed bug with time range in graphite panel

parent 1540e95b
...@@ -260,18 +260,19 @@ function (angular, app, $, _, kbn, moment, timeSeries) { ...@@ -260,18 +260,19 @@ function (angular, app, $, _, kbn, moment, timeSeries) {
}; };
$scope.updateTimeRange = function () { $scope.updateTimeRange = function () {
$scope.range = filterSrv.timeRange(); var range = filterSrv.timeRange();
$scope.interval = $scope.panel.interval; var interval = filterSrv.timeRange();
if ($scope.panel.auto_int) { if ($scope.panel.auto_int) {
if ($scope.range) { if (range) {
$scope.interval = kbn.secondsToHms( interval = kbn.secondsToHms(
kbn.calculate_interval($scope.range, $scope.range, $scope.panel.resolution, 0) / 1000 kbn.calculate_interval(range.from, range.to, $scope.panel.resolution, 0) / 1000
); );
} }
} }
$scope.panel.interval = $scope.interval || '10m';
$scope.interval = $scope.panel.interval; $scope.interval = $scope.panel.interval = interval || '10m';
$scope.range = range;
}; };
$scope.colors = [ $scope.colors = [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment