Skip to content

v3 removed the ability to pass custom tooltip formatter through chart components #6210

Description

@lauri865

What is the current behavior?

formatter prop from chart components is no longer passed to the entry of a tooltip.

This code block seems to be redundant now – how can entry.formatter ever be defined?:

const finalFormatter = entry.formatter || formatter || defaultFormatter;

What is the expected behavior?

Old behaviour (even though it wasn't properly typed, it allowed better composability of tooltip formatters imho, it's bad ergonomics to have to run conditional logic based on dataKeys, especially if some charts are conditionally/dynamically rendered): https://codesandbox.io/p/sandbox/nice-bush-vhvyjp?file=%2Fsrc%2FApp.tsx

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementEnhancement to a current APIfeature requestIssues that are feature requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions