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
RadarChart PolarAngleAxis getting cut off. #4266
Comments
That is fine until you make the chart smaller (say width 350) then you have to play with the margins until it fits? This makes no sense. If I use scaleToFIt or set a width on the Text it should wrap automatically (not just when the label has spaces). |
is using percentages an issue? Recharts doesn't have any magic/dynamic "scale to fit" solutions for any charts at the moment besides using a That being said, For now I would just use something custom like the following or use a tick={(props) => {
const { payload, ...rest } = props;
return <text {...rest}>{payload?.value}</text>;
}} Here is a sandbox containing some of the not great behavior of the text component The transform done here is incorrect it seems https://github.com/recharts/recharts/blob/3.x/src/component/Text.tsx#L243 |
@ckifer thanks for the responses. I tried different iterations of using Text with width and scaleToFit and no labels show up when I do that (tweak my original codesandbox above and add width). What I ended up doing is trimming the labels and concating '...' if they were too long. Not idea but it is all I could come up with.
|
Thanks for understanding! If you'd like to contribute feel free! there's a ton of improvements to be had 😅 |
Reproduction link
Steps to reproduce
Wrapping only happens if there is a space in the label. I would expect it to wrap regardless. Using scaleToFit removes the label entirely with or without a width.
What is expected?
Wrapping regardless of label containing spaces or scaleToFit to work.
What is actually happening?
See example above...text wraps only if label contains a space OR scaleToFit to work.
The text was updated successfully, but these errors were encountered: