diff --git a/packages/grafana-ui/src/types/data.ts b/packages/grafana-ui/src/types/data.ts index e629e76043a..d1a1a785777 100644 --- a/packages/grafana-ui/src/types/data.ts +++ b/packages/grafana-ui/src/types/data.ts @@ -47,7 +47,6 @@ export interface Field { unit?: string; dateFormat?: string; // Source data format decimals?: number | null; // Significant digits (for display) - color?: string; min?: number | null; max?: number | null; } diff --git a/packages/grafana-ui/src/utils/displayValue.test.ts b/packages/grafana-ui/src/utils/displayValue.test.ts index 63c78e97982..139286acc01 100644 --- a/packages/grafana-ui/src/utils/displayValue.test.ts +++ b/packages/grafana-ui/src/utils/displayValue.test.ts @@ -18,7 +18,7 @@ describe('Process simple display values', () => { getDisplayProcessor(), // Add a simple option that is not used (uses a different base class) - getDisplayProcessor({ field: { color: '#FFF' } }), + getDisplayProcessor({ field: { min: 0, max: 100 } }), // Add a simple option that is not used (uses a different base class) getDisplayProcessor({ field: { unit: 'locale' } }), diff --git a/packages/grafana-ui/src/utils/displayValue.ts b/packages/grafana-ui/src/utils/displayValue.ts index 59a04fefc2b..6565985f445 100644 --- a/packages/grafana-ui/src/utils/displayValue.ts +++ b/packages/grafana-ui/src/utils/displayValue.ts @@ -42,7 +42,7 @@ export function getDisplayProcessor(options?: DisplayValueOptions): DisplayProce return (value: any) => { const { mappings, thresholds, theme } = options; - let color = field.color; + let color; let text = _.toString(value); let numeric = toNumber(value); @@ -76,7 +76,7 @@ export function getDisplayProcessor(options?: DisplayValueOptions): DisplayProce const { decimals, scaledDecimals } = getDecimalsForValue(value, field.decimals); text = formatFunc(numeric, decimals, scaledDecimals, options.isUtc); } - if (thresholds && thresholds.length > 0) { + if (thresholds && thresholds.length) { color = getColorFromThreshold(numeric, thresholds, theme); } }