ngx-charts
ngx-charts copied to clipboard
Vertical Bar Charts don't align to base properly
Describe the bug A clear and concise description of what the bug is. You can see on any of the vertical bar chart example pages that the bases of all bars don't line up properly, probably by a pixel but it's noticeable.
To Reproduce Steps to reproduce the behavior: View any of the following demo pages and look at the bottom of each of the bars. https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical-2d https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical-stacked
Expected behavior All the bars should line up properly.
Screenshots
If applicable, add screenshots to help explain your problem.
Demo Provide an online demo (stackblitz, codesandbox, or similar) where the issue can be reproduced https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical-2d https://swimlane.github.io/ngx-charts/#/ngx-charts/bar-vertical-stacked
ngx-charts version 13.0.3
Additional context Add any other context about the problem here.
Happens to me too.
I am facing the similar issue.
For me it doesn't align to bottom properly, when ever the different data set value is coming and width and height of the chart container is very small([200, 40]).
But if the all bar height is same it looks proper. Please find the attached screen shots.

Same issue here but I didn't have this issue in previous versions
Same issue for me as well. Does anyone has a fix / workaround?
I have the same issue. It seems to be a rounding error in the lib. If I normalize my data so that the max value corresponds to the height of the graph the issue goes away. Unfortunately that's not a solution as that also means the normalized values are used in the tooltips, and they need to be the originals.
I have exactly this issue as well. This is not workable as it looks terrible. A workaround would be great.