recharts / recharts

Redefined chart library built with React and D3
http://recharts.org
MIT License
23.74k stars 1.69k forks source link

PROPS LIKE HEIGHT, X ARE passing as null in shape prop for Bar #4836

Open jackvik opened 1 month ago

jackvik commented 1 month ago

Do you want to request a feature or report a bug?

No

What is the current behavior?

props like x, height, background:{height} are coming as null when we try to access custom shape in the shape prop or Bar. Bar is part of ComposedChart which is further chiled of responsive container.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via codesandbox or similar (template: https://codesandbox.io/p/sandbox/simple-line-chart-v25dl4).

What is the expected behavior?

The values of height, x and background props should come.

Which versions of Recharts, and which browser / OS are affected by this issue? Did this work in previous versions of Recharts?

It's not coming in version 2.12.7 v but coming correctly in version 1.8.5.

Code Snipped: `

} />
  </ResponsiveContainer>`

I am trying to access x, background:{height} and height in CustomizedBar component

jackvik commented 1 month ago

@ckifer can you please look into this if possible. Thanks

ckifer commented 1 month ago

As this may have been this way for a long time (since 1.x) this issue isn't a huge priority. There will be new ways to get these values in 3.x

If you could look into the exact version it broke that would go a long way helping address/prioritize it.