Skip to content

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

Description

@mpunak

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions