mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
BarChart: Fix value mappings (#60066)
This commit is contained in:
parent
6f9ee7acf9
commit
8317bf5def
@ -242,7 +242,17 @@ export const BarChartPanel: React.FunctionComponent<Props> = ({
|
|||||||
f.config.custom?.gradientMode === GraphGradientMode.Scheme &&
|
f.config.custom?.gradientMode === GraphGradientMode.Scheme &&
|
||||||
f.config.color?.mode === FieldColorModeId.Thresholds;
|
f.config.color?.mode === FieldColorModeId.Thresholds;
|
||||||
|
|
||||||
return fromThresholds || f.config.mappings?.some((m) => m.options.result.color != null);
|
return (
|
||||||
|
fromThresholds ||
|
||||||
|
f.config.mappings?.some((m) => {
|
||||||
|
// ValueToText mappings have a different format, where all of them are grouped into an object keyed by value
|
||||||
|
if (m.type === 'value') {
|
||||||
|
// === MappingType.ValueToText
|
||||||
|
return Object.values(m.options).some((result) => result.color != null);
|
||||||
|
}
|
||||||
|
return m.options.result.color != null;
|
||||||
|
})
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (hasPerBarColor) {
|
if (hasPerBarColor) {
|
||||||
|
Loading…
Reference in New Issue
Block a user