Skip to content

Commit

Permalink
[charts] Allow SeriesValueFormatter to return null value (@clins1994
Browse files Browse the repository at this point in the history
) (mui#15295)

Co-authored-by: Caio Lins <[email protected]>
  • Loading branch information
github-actions[bot] and clins1994 authored Nov 6, 2024
1 parent 132f758 commit d275788
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 d275788

Please sign in to comment.