swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Vertical Bar Charts don't align to base properly #1459

Open crlang44 opened 4 years ago

crlang44 commented 4 years ago

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. image

image

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.

blogcraft commented 4 years ago

Happens to me too.

Rahulkupadhyay commented 4 years ago

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.

Screenshot 2020-07-31 at 12 33 44 AM Screenshot 2020-07-31 at 12 26 39 AM
HusFNS commented 3 years ago

Same issue here but I didn't have this issue in previous versions

sebastientromp commented 3 years ago

Same issue for me as well. Does anyone has a fix / workaround?

artlowel commented 2 years ago

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.

roldengarm commented 2 years ago

I have exactly this issue as well. This is not workable as it looks terrible. A workaround would be great.