diff --git a/public/app/features/panel/panelHelper.js b/public/app/features/panel/panelHelper.js index c7473692a43..f0d4f98ee9c 100644 --- a/public/app/features/panel/panelHelper.js +++ b/public/app/features/panel/panelHelper.js @@ -59,7 +59,9 @@ function (angular, dateMath, rangeUtil, _, kbn, $) { scope.resolution = Math.ceil($(window).width() * (scope.panel.span / 12)); } - scope.interval = kbn.calculateInterval(scope.range, scope.resolution, scope.panel.interval); + var panelInterval = scope.panel.interval; + var datasourceInterval = (scope.datasource || {}).interval; + scope.interval = kbn.calculateInterval(scope.range, scope.resolution, panelInterval || datasourceInterval); }; this.applyPanelTimeOverrides = function(scope) { diff --git a/public/app/plugins/datasource/elasticsearch/datasource.js b/public/app/plugins/datasource/elasticsearch/datasource.js index 374fc9da90d..21a5f929e89 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.js +++ b/public/app/plugins/datasource/elasticsearch/datasource.js @@ -24,6 +24,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes this.index = datasource.index; this.timeField = datasource.jsonData.timeField; this.indexPattern = new IndexPattern(datasource.index, datasource.jsonData.interval); + this.interval = datasource.jsonData.timeInterval; this.queryBuilder = new ElasticQueryBuilder({ timeField: this.timeField }); diff --git a/public/app/plugins/datasource/elasticsearch/partials/config.html b/public/app/plugins/datasource/elasticsearch/partials/config.html index d1cb05801d6..622d4cbdc86 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/config.html +++ b/public/app/plugins/datasource/elasticsearch/partials/config.html @@ -1,7 +1,7 @@