mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Table: Fixes issue with fixed min and auto max with bar gauge cell (#31316)
This commit is contained in:
@@ -65,14 +65,20 @@ function getMinMaxAndDelta(field: Field): NumericRange {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export function getFieldConfigWithMinMax(field: Field, local?: boolean): FieldConfig {
|
||||
const { config } = field;
|
||||
let { min, max } = config;
|
||||
if (isNumber(min) && !isNumber(max)) {
|
||||
return config; // noop
|
||||
|
||||
if (isNumber(min) && isNumber(max)) {
|
||||
return config;
|
||||
}
|
||||
|
||||
if (local || !field.state?.range) {
|
||||
return { ...config, ...getMinMaxAndDelta(field) };
|
||||
}
|
||||
|
||||
return { ...config, ...field.state.range };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user