diff --git a/src/app/panels/graph/module.js b/src/app/panels/graph/module.js index 9afb77fd947..86546da2d1d 100644 --- a/src/app/panels/graph/module.js +++ b/src/app/panels/graph/module.js @@ -178,7 +178,12 @@ function (angular, app, $, _, kbn, moment, TimeSeries) { $scope.updateTimeRange = function () { $scope.range = timeSrv.timeRange(); $scope.rangeUnparsed = timeSrv.timeRange(false); - $scope.resolution = Math.ceil($(window).width() * ($scope.panel.span / 12)); + if ($scope.panel.maxDataPoints) { + $scope.resolution = $scope.panel.maxDataPoints; + } + else { + $scope.resolution = Math.ceil($(window).width() * ($scope.panel.span / 12)); + } $scope.interval = kbn.calculateInterval($scope.range, $scope.resolution, $scope.panel.interval); }; diff --git a/src/app/panels/singlestat/module.js b/src/app/panels/singlestat/module.js index 1dba78d1ced..8c6a77defa8 100644 --- a/src/app/panels/singlestat/module.js +++ b/src/app/panels/singlestat/module.js @@ -37,6 +37,8 @@ function (angular, app, _, TimeSeries, kbn) { // Set and populate defaults var _d = { + maxDataPoints: 100, + interval: null, targets: [{}], cacheTimeout: null, format: 'none', @@ -68,6 +70,8 @@ function (angular, app, _, TimeSeries, kbn) { $scope.updateTimeRange = function () { $scope.range = timeSrv.timeRange(); $scope.rangeUnparsed = timeSrv.timeRange(false); + $scope.resolution = $scope.panel.maxDataPoints; + $scope.interval = kbn.calculateInterval($scope.range, $scope.resolution, $scope.panel.interval); }; $scope.get_data = function() { @@ -75,9 +79,9 @@ function (angular, app, _, TimeSeries, kbn) { var metricsQuery = { range: $scope.rangeUnparsed, - interval: '1min', + interval: $scope.interval, targets: $scope.panel.targets, - maxDataPoints: 100, + maxDataPoints: $scope.resolution, cacheTimeout: $scope.panel.cacheTimeout }; diff --git a/src/app/partials/graphite/editor.html b/src/app/partials/graphite/editor.html index 77ef46a7e39..b904331e77c 100755 --- a/src/app/partials/graphite/editor.html +++ b/src/app/partials/graphite/editor.html @@ -96,16 +96,29 @@