mantine icon indicating copy to clipboard operation
mantine copied to clipboard

Recharts 3: Tooltip does not display correctly in BarChart when `orientation="vertical"`

Open vb-long opened this issue 6 months ago • 6 comments

Dependencies check up

  • [x] I have verified that I use latest version of all @mantine/* packages

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

"@mantine/charts": "8.2.2",
"@mantine/core": "8.2.2",
"@mantine/hooks": "8.2.2",
"recharts": "3.0.2",

What package has an issue?

@mantine/charts

What framework do you use?

Next.js

In which browsers you can reproduce the issue?

Chrome

Describe the bug

Bug

When setting the orientation prop to vertical in <BarChart>, the tooltip does not display correctly.

Expected

The tooltips should behave the same as they do when orientation="horizontal"

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

https://codesandbox.io/p/sandbox/mantine-barchart-s6d7hq

Possible fix

No response

Self-service

  • [ ] I would be willing to implement a fix for this issue

vb-long avatar Aug 01 '25 02:08 vb-long

OMG, it was driving me crazy; I thought I'm doing something wrong.

Why is the Website example working fine? 🤔

EDIT: I'm using version 8.2.1, so I don't think it's a 8.2.2-specific issue (I have recharts 3.1.0)

farzadmf avatar Aug 01 '25 03:08 farzadmf

I think the issue is with Recharts. When I use the same code with Recharts v2, it displays correctly, but it fails with Recharts v3

https://codesandbox.io/p/sandbox/d3x4hx

vb-long avatar Aug 01 '25 04:08 vb-long

Weird, and checking out their releases, I feel like v2 shouldn't be used; quoting them for latest v2 version:

releasing since the @babel/runtime vulnerability is showing up in some security scans. Hoping to release 3.0 on 6/22 🚀

Or I'm misunderstanding and "hoping to release 3.0" doesn't have anything to do with deprecating v2

farzadmf avatar Aug 01 '25 04:08 farzadmf

As mentioned in the release, Mantine was just updated to support Recharts v3, so there may still be some minor issues. Maybe check the diff to see what might be causing them

vb-long avatar Aug 01 '25 05:08 vb-long

I'm having the same issue with Mantine 8.3.1 and rechart 3.2.1

moimael avatar Sep 25 '25 14:09 moimael

The fix will be provided in Mantine 9.0 which is scheduled to release next year. For now, if the issue is critical for you, please downgrade to recharts 2.x until 9.0 release or workaround available.

rtivital avatar Sep 25 '25 15:09 rtivital