Просмотр исходного кода

graph: minor refactor of histogram mode PR #8613

Alexander Zobnin 7 лет назад
Родитель
Сommit
30d077d1d1
2 измененных файлов с 1 добавлено и 5 удалено
  1. 1 3
      public/app/plugins/panel/graph/graph.ts
  2. 0 2
      public/app/plugins/panel/graph/histogram.ts

+ 1 - 3
public/app/plugins/panel/graph/graph.ts

@@ -242,10 +242,8 @@ function graphDirective(timeSrv, popoverSrv, contextSrv) {
               let histMax = _.max(_.map(data, s => s.stats.max));
               let histMax = _.max(_.map(data, s => s.stats.max));
               let ticks = panel.xaxis.buckets || panelWidth / 50;
               let ticks = panel.xaxis.buckets || panelWidth / 50;
               bucketSize = tickStep(histMin, histMax, ticks);
               bucketSize = tickStep(histMin, histMax, ticks);
-
-              data = convertToHistogramData(data, bucketSize, ctrl.hiddenSeries, panel.stack, histMin, histMax);
-
               options.series.bars.barWidth = bucketSize * 0.8;
               options.series.bars.barWidth = bucketSize * 0.8;
+              data = convertToHistogramData(data, bucketSize, ctrl.hiddenSeries, histMin, histMax);
             } else {
             } else {
               bucketSize = 0;
               bucketSize = 0;
             }
             }

+ 0 - 2
public/app/plugins/panel/graph/histogram.ts

@@ -59,13 +59,11 @@ export function convertValuesToHistogram(values: number[], bucketSize: number, m
  * Convert series into array of histogram data.
  * Convert series into array of histogram data.
  * @param data Array of series
  * @param data Array of series
  * @param bucketSize
  * @param bucketSize
- * @param stack
  */
  */
 export function convertToHistogramData(
 export function convertToHistogramData(
   data: any,
   data: any,
   bucketSize: number,
   bucketSize: number,
   hiddenSeries: any,
   hiddenSeries: any,
-  stack = false,
   min: number,
   min: number,
   max: number
   max: number
 ): any[] {
 ): any[] {