From 8c83e45ea1c3b14ad424dee80be1d3d910de3448 Mon Sep 17 00:00:00 2001 From: alexandre Date: Thu, 1 Feb 2024 12:03:28 +0100 Subject: [PATCH] Fix tooltip crash when out of range axis --- packages/x-charts/src/BarChart/formatter.ts | 4 +--- packages/x-charts/src/LineChart/formatter.ts | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/x-charts/src/BarChart/formatter.ts b/packages/x-charts/src/BarChart/formatter.ts index 2c7d571fb0772..e7cc322ad8142 100644 --- a/packages/x-charts/src/BarChart/formatter.ts +++ b/packages/x-charts/src/BarChart/formatter.ts @@ -86,9 +86,7 @@ const formatter: Formatter<'bar'> = (params, dataset) => { return { seriesOrder, stackingGroups, - series: defaultizeValueFormatter(completedSeries, (v) => - v === null ? '' : v.toLocaleString(), - ), + series: defaultizeValueFormatter(completedSeries, (v) => (v == null ? '' : v.toLocaleString())), }; }; diff --git a/packages/x-charts/src/LineChart/formatter.ts b/packages/x-charts/src/LineChart/formatter.ts index 7734671d42053..d041eff126794 100644 --- a/packages/x-charts/src/LineChart/formatter.ts +++ b/packages/x-charts/src/LineChart/formatter.ts @@ -83,9 +83,7 @@ const formatter: Formatter<'line'> = (params, dataset) => { return { seriesOrder, stackingGroups, - series: defaultizeValueFormatter(completedSeries, (v) => - v === null ? '' : v.toLocaleString(), - ), + series: defaultizeValueFormatter(completedSeries, (v) => (v == null ? '' : v.toLocaleString())), }; };