From c719016e0a63cc6a8badc4b9909b49e71c7893c5 Mon Sep 17 00:00:00 2001 From: alexandre Date: Mon, 19 Feb 2024 09:41:18 +0100 Subject: [PATCH] [charts] Don't display text if no value provided --- packages/x-charts/src/Gauge/GaugeValueText.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/x-charts/src/Gauge/GaugeValueText.tsx b/packages/x-charts/src/Gauge/GaugeValueText.tsx index ace6f9607344..a7c054eae2d3 100644 --- a/packages/x-charts/src/Gauge/GaugeValueText.tsx +++ b/packages/x-charts/src/Gauge/GaugeValueText.tsx @@ -14,7 +14,7 @@ export interface GaugeValueTextProps extends Omit { } function defaultFormatter({ value }: GaugeFormatterParams) { - return value === null ? 'NaN' : value.toLocaleString(); + return value === null ? null : value.toLocaleString(); } function GaugeValueText(props: GaugeValueTextProps) { const { text = defaultFormatter, className, ...other } = props;