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

Implement showDatumInTooltip in TooltipOptions to allow hiding certain datums in regular TooltipRenderer. #360

Merged

Conversation

Zandor300
Copy link
Contributor

@Zandor300 Zandor300 commented Nov 2, 2023

I wanted to be able to hide datums with value 0 in my chart and couldn't find a way to do this with the current implementation, except write my own TooltipRenderer which I didn't feel like doing.

So this PR will add showDatumInTooltip in TooltipOptions to be able to filter datums that are shown in the regular TooltipRenderer.

@tannerlinsley Could you take a look?

Example usage

<Chart
    options={{
        data,
        primaryAxis,
        secondaryAxes,
        tooltip: {
            showDatumInTooltip: (datum) => {
                return datum.originalDatum.value !== 0;
            }
        }
    }}
/>

@tannerlinsley tannerlinsley merged commit 582bc33 into TanStack:beta Nov 2, 2023
@tannerlinsley
Copy link
Collaborator

🎉 This PR is included in version 3.0.0-beta.57 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants