-
Notifications
You must be signed in to change notification settings - Fork 2.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
Hide overlapping x-axis tick labels #32829
Hide overlapping x-axis tick labels #32829
Conversation
return convertToLocaleString(dataset[index], culture) as string; | ||
}); | ||
.tickValues(tickValues) | ||
.tickFormat(tickFormat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ToDo: add unit tests for this logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, will add the unit tests once the logic is finalized. Still have to cover scenarios like rotation, wrapping and truncation of tick labels. Also noticed that the calculateLongestLabelWidth util does not give very accurate results.
packages/react-components/react-charts-preview/library/src/utilities/utilities.ts
Show resolved
Hide resolved
Could you resolve the conflict of change in prop name in upstream branch |
…luentui into hide-tick-overlap
020ddb9
to
e0193ea
Compare
There is another conflict being reported. Could you resolve it. |
…luentui into hide-tick-overlap
Previous Behavior
The default number of x-axis ticks causes tick labels to overlap in smaller viewports.
New Behavior
When the hideTickOverlap prop is set to true, continuous axes (such as number and date) automatically adjust their tick count based on the container width, while categorical/string axes hide any tick labels that might overlap.