ngx-charts icon indicating copy to clipboard operation
ngx-charts copied to clipboard

Vertical Bar Charts don't align to base properly

Open crlang44 opened this issue 4 years ago • 6 comments

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.

crlang44 avatar Jun 09 '20 22:06 crlang44

Happens to me too.

blogcraft avatar Jul 30 '20 00:07 blogcraft

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

Rahulkupadhyay avatar Jul 30 '20 19:07 Rahulkupadhyay

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

HusFNS avatar Oct 16 '20 08:10 HusFNS

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

sebastientromp avatar Nov 10 '20 16:11 sebastientromp

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.

artlowel avatar Dec 21 '21 11:12 artlowel

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

roldengarm avatar Jun 02 '22 04:06 roldengarm