mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge pull request #14179 from mattiarossi/master
Add support for offset in date histogram aggregation
This commit is contained in:
@@ -70,6 +70,16 @@
|
||||
</label>
|
||||
<input class="gf-form-input max-width-12" type="number" ng-model="agg.settings.trimEdges" ng-change="onChangeInternal()">
|
||||
</div>
|
||||
<div class="gf-form offset-width-7">
|
||||
<label class="gf-form-label width-10">
|
||||
Offset
|
||||
<info-popover mode="right-normal">
|
||||
Change the start value of each bucket by the specified positive (+) or negative offset (-) duration, such as 1h for an hour, or 1d for a day
|
||||
</info-popover>
|
||||
</label>
|
||||
<input class="gf-form-input max-width-12" type="text" ng-model="agg.settings.offset" ng-change="onChangeInternal()">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div ng-if="agg.type === 'histogram'">
|
||||
|
||||
@@ -72,6 +72,10 @@ export class ElasticQueryBuilder {
|
||||
esAgg.extended_bounds = { min: '$timeFrom', max: '$timeTo' };
|
||||
esAgg.format = 'epoch_millis';
|
||||
|
||||
if (settings.offset !== '') {
|
||||
esAgg.offset = settings.offset;
|
||||
}
|
||||
|
||||
if (esAgg.interval === 'auto') {
|
||||
esAgg.interval = '$__interval';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user