Skip to content
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

Y-Axis Tick Labels Cut Off #1757

Open
100starnight opened this issue Jul 14, 2022 · 1 comment
Open

Y-Axis Tick Labels Cut Off #1757

100starnight opened this issue Jul 14, 2022 · 1 comment

Comments

@100starnight
Copy link

Bug:

Y-axis tick labels automatically get cut off if they're longer than 3em, which seems to be arbitrarily set here for the left axis and here for the right one in the d3fc-chart/src/css.js file

Expected Behavior:

The default behavior should be for tick labels to fit in the axis (especially because tick labels aren't always known in advance, which makes manually setting the axis width unfeasible)

Example:

Here's examples/simple-chart with the data scaled up so that the labels are long enough to trigger the bug:
Screen Shot 2022-07-14 at 11 10 29 AM

@ColinEberhardt
Copy link
Member

Determining whether an axis label will 'overflow' requires measuring the rendered size of the labels, which is an expensive operation. By default, D3 and D3FC avoid this type of behaviour in order to provide the best performance possible.

We do provide adapters that perform measure operations and either rotate or stack the axis labels in order to avoid collisions / overflow.

There isn't an adapter that provides exactly the functionality you describe, but it should be possible to build one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants