mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
graph: minor refactor of histogram mode PR #8613
This commit is contained in:
parent
38a19f7c90
commit
30d077d1d1
@ -242,10 +242,8 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
|
||||
let histMax = _.max(_.map(data, s => s.stats.max));
|
||||
let ticks = panel.xaxis.buckets || panelWidth / 50;
|
||||
bucketSize = tickStep(histMin, histMax, ticks);
|
||||
|
||||
data = convertToHistogramData(data, bucketSize, ctrl.hiddenSeries, panel.stack, histMin, histMax);
|
||||
|
||||
options.series.bars.barWidth = bucketSize * 0.8;
|
||||
data = convertToHistogramData(data, bucketSize, ctrl.hiddenSeries, histMin, histMax);
|
||||
} else {
|
||||
bucketSize = 0;
|
||||
}
|
||||
|
@ -59,13 +59,11 @@ export function convertValuesToHistogram(values: number[], bucketSize: number, m
|
||||
* Convert series into array of histogram data.
|
||||
* @param data Array of series
|
||||
* @param bucketSize
|
||||
* @param stack
|
||||
*/
|
||||
export function convertToHistogramData(
|
||||
data: any,
|
||||
bucketSize: number,
|
||||
hiddenSeries: any,
|
||||
stack = false,
|
||||
min: number,
|
||||
max: number
|
||||
): any[] {
|
||||
|
Loading…
Reference in New Issue
Block a user