mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 02:04:07 +08:00
Updated bucket size/offeset settings; Check for negative values in bucket size (#46754)
This commit is contained in:
@ -152,7 +152,7 @@ export function buildHistogram(frames: DataFrame[], options?: HistogramTransform
|
||||
let bucketOffset = options?.bucketOffset ?? 0;
|
||||
|
||||
// if bucket size is auto, try to calc from all numeric fields
|
||||
if (!bucketSize) {
|
||||
if (!bucketSize || bucketSize < 0) {
|
||||
let allValues: number[] = [];
|
||||
|
||||
// TODO: include field configs!
|
||||
|
@ -23,6 +23,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(HistogramP
|
||||
description: histogramFieldInfo.bucketSize.description,
|
||||
settings: {
|
||||
placeholder: 'Auto',
|
||||
min: 0,
|
||||
},
|
||||
defaultValue: defaultPanelOptions.bucketSize,
|
||||
showIf: (opts, data) => !originalDataHasHistogram(data),
|
||||
@ -33,6 +34,7 @@ export const plugin = new PanelPlugin<PanelOptions, PanelFieldConfig>(HistogramP
|
||||
description: histogramFieldInfo.bucketOffset.description,
|
||||
settings: {
|
||||
placeholder: '0',
|
||||
min: 0,
|
||||
},
|
||||
defaultValue: defaultPanelOptions.bucketOffset,
|
||||
showIf: (opts, data) => !originalDataHasHistogram(data),
|
||||
|
Reference in New Issue
Block a user