Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[charts] Allow SeriesValueFormatter to return null value #15057

Merged
merged 1 commit into from
Nov 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading