#X-axis grid lines not displaying correctly (only top and bottom lines visible) in v7.17.8
6 messages · Page 1 of 1 (latest)
Downgrade recharts to 2.x
Reported in https://github.com/mantinedev/mantine/issues/8110.
Looks like it's actually the yAxisId:
https://stackblitz.com/edit/react-qhmqzn5t?file=src%2FExample.tsx&showSidebar=0
If you switch to recharts 2.15.4 or remove the yAxisId="left" line or add an invisible reference line, the y-axis lines all show.
https://github.com/recharts/recharts/issues/6149#issuecomment-3128694341:
You'll need to specify your
yAxisIdexplicitly on the grid:
<CartesianGrid
strokeDasharray="5 5"
vertical={false}
horizontal={true}
yAxisId="left"
/>
The breaking changes were updated: https://github.com/recharts/recharts/wiki/3.0-migration-guide#other-breaking-changes
CartesianGridhas new propertiesx/yAxisIdthat correspond tox/yAxisIds on theX/YAxiscomponents respectively. With a different ID than default,CartesianGridlines will fail to render. This makes the grid rendering deterministic rather than just selecting the first axis it finds