mirror of
https://github.com/grafana/grafana.git
synced 2024-11-29 20:24:18 -06:00
SeriesData: remove color from Field (#17044)
This commit is contained in:
parent
01a7c1f098
commit
bbb1427f46
@ -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;
|
||||
}
|
||||
|
@ -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' } }),
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user