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

Width of bars on grouped vertical bar chart depends on height #1965

Open
rsporsche opened this issue Jun 24, 2024 · 1 comment
Open

Width of bars on grouped vertical bar chart depends on height #1965

rsporsche opened this issue Jun 24, 2024 · 1 comment
Labels

Comments

@rsporsche
Copy link

The width of the bars on the 'grouped vertical bar chart' change with the height of the chart. I would expect that the width of the bars should only depend on the width of the chart and the number of bars.

To Reproduce
Open the example here: https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical-2d
Change height from the default of 300, to 150, 120, 100, etc. and observe that the width of the bars is significantly reduced.

Expected behavior
I expect that the width of the bars does not change when only the height of the chart is changed

Screenshots
300 high:
image

120 high:
image

@rsporsche rsporsche added the Bug label Jun 24, 2024
@yoandyshyno
Copy link

This can be fixed by not applying "paddingInner" and "paddingOuter" on the result of function getGRoupScale. See: https://github.com/swimlane/ngx-charts/blob/ff89cfe08ada08ab898083be76cd0a6cc1adfdb2/projects/swimlane/ngx-charts/src/lib/bar-chart/bar-vertical-2d.component.ts#L267C2-L275C4

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

No branches or pull requests

2 participants