Skip to content

Commit

Permalink
[charts] Allow SeriesValueFormatter to return null value (#15057)
Browse files Browse the repository at this point in the history
  • Loading branch information
clins1994 authored Nov 5, 2024
1 parent 03b17aa commit f955ebb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/x-charts/src/models/seriesType/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export type SeriesValueFormatterContext = {
export type SeriesValueFormatter<TValue> = (
value: TValue,
context: SeriesValueFormatterContext,
) => string;
) => string | null;

export type CommonSeriesType<TValue> = {
id?: SeriesId;
Expand All @@ -22,7 +22,7 @@ export type CommonSeriesType<TValue> = {
* 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<TValue>;
/**
Expand Down

0 comments on commit f955ebb

Please sign in to comment.