diff --git a/packages/x-charts/src/models/seriesType/common.ts b/packages/x-charts/src/models/seriesType/common.ts index 471e06a7367f..356c8a4b4b23 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; /**