elastic / kibana

Your window into the Elastic Stack
https://www.elastic.co/products/kibana
Other
19.72k stars 8.13k forks source link

Fix bar chart minimum size #162028

Open JordanSh opened 1 year ago

JordanSh commented 1 year ago

The bar chart is using minimum size of 5px for each value, but as can be seen in the attached image, this value is not showing when there are multiple elements.

image

It seems to works when there are 2 elements as can be seen here:

image

This might need to be resolved by pushing a fix to euicharts

elasticmachine commented 1 year ago

Pinging @elastic/kibana-cloud-security-posture (Team:Cloud Security)

maxcold commented 1 year ago

Did some digging into the rendering of bar charts, seems like there is a problem with the coordinates of the bars drawn in canvas, not with the height. The bars are being drawn either on each other or outside of the visible area for some reason. Will create an issue in elastic-charts to start the conversation with the team, as fixing it myself doesn't seem trivial at first glance, we would need to go deeper into rendering logic of bar charts. On the gif you can see how in the first section the second bar is rendered outside of the visible area and in the third section two bars are being rendered on top of each other 2023-07-28 17 26 44

maxcold commented 1 year ago

created a bug ticket for elastic charts library. If it's a prio, can spend more trying to fix it myself there, but I suggest to wait some time for the answer from the charts team, maybe it's either a known bug with a workaround we can use or smth I'm missing in the usage of minBarHeight prop

kfirpeled commented 1 year ago

When doing this task, go ahead and assign yourself to https://github.com/elastic/elastic-charts/issues/2120 and fix it

maxcold commented 1 year ago

I removed myself from assignees and moved to todo as I'm not actively working on this ticket

ArchitGajjar commented 8 months ago

HI @JordanSh @kfirpeled @maxcold - is this issue still open ? can I work on this issue ?

maxcold commented 8 months ago

Hi @ArchitGajjar , yes, the issue most likely is still there. To fix it, most likely you need to fix this bug in the charting library we use https://github.com/elastic/elastic-charts/issues/2120 . You can go ahead and work on this issue, we'd appreciate any help