From d275788f085a3e1e9a8bc797c5b7845df703454c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Nov 2024 11:20:21 +0100 Subject: [PATCH] [charts] Allow `SeriesValueFormatter` to return `null` value (@clins1994) (#15295) Co-authored-by: Caio Lins --- packages/x-charts/src/models/seriesType/common.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/x-charts/src/models/seriesType/common.ts b/packages/x-charts/src/models/seriesType/common.ts index 5ec59cc45455..df9592b37d64 100644 --- a/packages/x-charts/src/models/seriesType/common.ts +++ b/packages/x-charts/src/models/seriesType/common.ts @@ -13,7 +13,7 @@ export type SeriesValueFormatterContext = { export type SeriesValueFormatter = ( value: TValue, context: SeriesValueFormatterContext, -) => string; +) => string | null; export type CommonSeriesType = { id?: SeriesId; @@ -22,7 +22,7 @@ export type CommonSeriesType = { * Formatter used to render values in tooltip or other data display. * @param {TValue} value The series' value to render. * @param {SeriesValueFormatterContext} context The rendering context of the value. - * @returns {string} The string to display. + * @returns {string | null} The string to display or null if the value should not be shown. */ valueFormatter?: SeriesValueFormatter; /**