mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
histogram: don't cut negative values, issue #8628
This commit is contained in:
parent
1da98f5e1e
commit
c1c1bcb874
@ -427,7 +427,7 @@ coreModule.directive('grafanaGraph', function($rootScope, timeSrv, popoverSrv) {
|
|||||||
ticks = _.map(data[0].data, point => point[0]);
|
ticks = _.map(data[0].data, point => point[0]);
|
||||||
|
|
||||||
// Expand ticks for pretty view
|
// Expand ticks for pretty view
|
||||||
min = Math.max(0, _.min(ticks) - bucketSize);
|
min = _.min(ticks) - bucketSize;
|
||||||
max = _.max(ticks) + bucketSize;
|
max = _.max(ticks) + bucketSize;
|
||||||
|
|
||||||
ticks = [];
|
ticks = [];
|
||||||
|
@ -38,9 +38,12 @@ export function convertValuesToHistogram(values: number[], bucketSize: number):
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return _.map(histogram, (count, bound) => {
|
let histogam_series = _.map(histogram, (count, bound) => {
|
||||||
return [Number(bound), count];
|
return [Number(bound), count];
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Sort by Y axis values
|
||||||
|
return _.sortBy(histogam_series, point => point[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getBucketBound(value: number, bucketSize: number): number {
|
function getBucketBound(value: number, bucketSize: number): number {
|
||||||
|
Loading…
Reference in New Issue
Block a user