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

Small gap between vertical stack bars #892

Open soothran opened 6 years ago

soothran commented 6 years ago

I'm submitting a ... (check one with "x")

In the vertical stacked bar chart a very small but noticeable gap is there between two bars

I need to display the chart with no gap between vertical bars It seems the sum of individual heights of stacked bars is less than the height of wrapper element. If I'm not wrong, the first bar's height in a single stack is taking the absolute value of its actual height. But the second bar is taking the real value.

Reproduction of the problem

What is the motivation / use case for changing the behavior?

Please tell us about your environment:

bellagamba commented 6 years ago

Same issue here:

capture

simeyla commented 5 years ago

It looks especially bad because it isn't consistent from one bar to the next :-( This is kind of a border line (pun intended) deal breaker type issue because it looks so bad. I'd be better off just drawing a bunch of DIVs myself on top of each other :-/

image

Wondered if it was related to hi-dpi screens, but my screen is at 200% so I doubt it.

If I set the stroke to the same as the fill color it's an adequate solution but I don't know how to actually do that in the code.

pathakparth commented 5 years ago

Facing the same issue with my current project. Any fix/work around/solutions yet ?

zhangxin511 commented 5 years ago

I have a PR in https://github.com/swimlane/ngx-charts/pull/1086

richard-grosjean commented 4 years ago

Same issue here: image

@zhangxin511 's addition didn't seem to help for me

bene-we commented 3 years ago

Same for me, thought it was because of the different colors I used. After removing the colorScheme the problem appears even stronger:

image

Adding a stroke to the elements as mentioned by @simeyla helps covering the gaps mostly (image below, left bar with stroke in the same color), though I am not able to implement that using the random colorScheme.

image

I also recognized that the gap size seems to change with the height of the chart itself.

Any workaround for this?

hill commented 3 years ago

1469 appears to be a solution to this. Could this PR get merged?

gregkaczan commented 12 months ago

so 5 years later and still here..

see You all in 2027 :D