mantinedev / mantine

A fully featured React components library
https://mantine.dev
MIT License
26.79k stars 1.9k forks source link

Tooltip properties not applied on chart components #6885

Closed temphiza closed 1 month ago

temphiza commented 1 month ago

Dependencies check up

What version of @mantine/* packages do you have in package.json?

7.13.0

What package has an issue?

@mantine/charts

What framework do you use?

Vite

In which browsers you can reproduce the issue?

Chrome

Describe the bug

tooltipProps is not used in the ChartTooltip internal component.

If possible, include a link to a codesandbox with a minimal reproduction

No response

Possible fix

No response

Self-service

Kenzo-Wada commented 1 month ago

@temphiza

I think tooltipProps just works fine to make customTooltip, what is your exact problem is? https://mantine.dev/charts/area-chart/#custom-tooltip

rtivital commented 1 month ago

tooltipProps are pass down to recharts Tooltip component, not to custom Mantine tooltip component. This prop works as intended.

temphiza commented 1 month ago

I tried to use labelFormatter which is part of tooltipProps but that function is not applied, see this line:

https://github.com/mantinedev/mantine/blob/59a078c73988ac01c8c3966bd00f1d88a10ba898/packages/%40mantine/charts/src/ChartTooltip/ChartTooltip.tsx#L188

rtivital commented 1 month ago

ChartTooltip component is not part of recharts. If you want to customize the content of the tooltip, create a custom tooltip component.