From e1088e9360eede7ee738cf13e59ba550d5fc3cd4 Mon Sep 17 00:00:00 2001 From: Ryan McKinley Date: Thu, 27 May 2021 15:32:20 -0700 Subject: [PATCH] Stat: don't show sparkline if y field is not number (#34857) --- .../grafana-ui/src/components/BigValue/BigValueLayout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx b/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx index 0e9c3b40e7b..195fe21d914 100644 --- a/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx +++ b/packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx @@ -3,7 +3,7 @@ import React, { CSSProperties } from 'react'; import tinycolor from 'tinycolor2'; // Utils -import { formattedValueToString, DisplayValue, FieldConfig } from '@grafana/data'; +import { formattedValueToString, DisplayValue, FieldConfig, FieldType } from '@grafana/data'; import { calculateFontSize } from '../../utils/measureText'; // Types @@ -151,7 +151,7 @@ export abstract class BigValueLayout { renderChart(): JSX.Element | null { const { sparkline, colorMode } = this.props; - if (!sparkline || !sparkline.y) { + if (!sparkline || sparkline.y?.type !== FieldType.number) { return null; }