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

Bar Chart has margin/padding on left and right even when no Y-Axis visible #5818

Closed
mpunak opened this issue Nov 8, 2018 · 1 comment
Closed

Comments

@mpunak
Copy link

mpunak commented Nov 8, 2018

Expected behavior
Hiding an Axis by setting the option display:false for the axis should have the chart render without padding to accommodate the space previously occupied by the axis.

Current Behavior
Hiding the Y Axis only performs the expected behavior if the X axis is also hidden. If the X Axis is visible, hiding the Y axis will not cause the chart to re scale to consume the area previously used by the now hidden Y Axis.

Hiding the X Axis performs the expected behavior, re scaling the bars/display area of the chart to consume the area previously used by the now hidden X Axis.

https://jsfiddle.net/ceg2qntd/3/

Steps to Reproduce

  1. Click on the "Toggle X" button and notice how the chart resizes itself to consume the space previously occupied by the X Axis
  2. Click on the "Toggle Y" button with the X Axis visible and notice how the chart does NOT resize itself to consume the space previously occupied by the visible Y Axis
  3. Click on the "Toggle Y" button with the X Axis hidden and notice how the chart resizes itself to consume the space previously occupied by the visible Y Axis

Context

Proper sizing/padding/margin control on the chart is crucial for proper alignment with elements outside of the chart itself.

@nagix
Copy link
Contributor

nagix commented Nov 9, 2018

It seems that extra spaces are added on the left and right based on the tick label widths. I guess these spaces are required when offset is false but it should be differently calculated when it is true.

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

2 participants