-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Incorrect hovering behaviour of StackedBarChart #5124
Comments
Does this happen on previous versions or no? |
v2.13.0-alpha.5 - yes, same behaviour releases from 2.12.0 to 2.12.7 show me error |
I'll take a look but I'm currently on vacation and can't address this for ~2 weeks |
it looks like the hovering functionality for |
https://codesandbox.io/p/sandbox/stacked-bar-chart-forked-p3tp97 This is possible only without an
|
Adding |
I would think so but not sure, I'll check and get back |
I can't seem to reproduce the issue with onMouseEnter/Leave |
Hello everyone who's watching this issue! We have released an alpha version Here is a migration guide: https://github.com/recharts/recharts/wiki/3.0-migration-guide As of now we have fixed all the new 3.x bugs we are aware of so, and are ready for your feedback. Please feel free to try |
Seems like after upgrading to v3 i get a "XXX cannot be used as a JSX component" whenever i import anything like a Barchart or similar.
Full error:
|
What React and Typescript versions are you using? I can run your config without issue |
"typescript": "^5.7.3" I will create a full example, i am using a monorepo so there might be something i missed |
@ckifer I made a brand new nextjs project and just installed recharts: 3.0.0-alpha.2 without even changing the default config to mine and i got the same error: Here is a full repo: CartesianGrid works fine |
@zommerberg looks like this is something specific to React 19 and React 19 types or something specific to Next 15 ts-config. Please create a separate issue since this issue isn't related |
@zommerberg this is your solution mapbox/mapbox-sdk-js#477 (comment) |
Can confirm |
@PavelVanecek You mean moving the types/react from dev dependency to normal dependency? The sample project had this library pre-installer already. Is there a reason why CartesianGrid works fine without any patches, but the other components require a patch? |
Ah I didn't notice. I also modified the tsconfig. Following the link from Coltin above. |
The fix might be tricky to do in monorepos and it definitely feels like something is broken with the library itself. I looked into the CartesianGrid component which works fine without any fixes and compared it with ResponsiveContainer It seems like But i havent verified it 100% |
Nothing requires a patch. This is a next issue with react types. It seems next cannot find the correct version of react types for whatever reason upon install. Once it can find the types with the TS config changes, everything is fine. Not sure what else we can do when it works correctly for all other types of new projects. Feel free to investigate more if you'd like |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
I want to highlight only the rectangles within the bar that I hovered over. I set it up to have a different tooltip for each rectangle in the bar via
<Tooltip shared={false} />
. I use<Bar activeBar={{ fill: "#82ca9dCC" }} />
to fill the hovered area with a lighter color. However, when I hover over the bar, the active bar overlaps the remaining bars.Steps to reproduce and demo of the problem
Codesandbox: https://codesandbox.io/p/sandbox/stacked-bar-chart-forked-p3tp97
Here is the demo:
What is the expected behavior?
When I hover an area - it is highlighted.
Which versions of Recharts, and which browser / OS are affected by this issue?
Recharts: 2.13.0
Google Chrome: 129
OS: MacOS 15.0
The text was updated successfully, but these errors were encountered: