Screenshot

Apache Superset Total value labels on horizontal bar chart get truncated on the far right Apache Superset Total value labels on horizontal bar chart get truncated on the far right Apache Superset Total value labels on horizontal bar chart get truncated on the far right

Description

X axis on bar chart doesn't show up properly on a lot of situations. When you use the horizontal bar chart and you set the X axis format to %, on smaller screens they just can't be read, because they overlap. Also, with percentages like 99%ish (when you select SHOW VALUES) you get the numbers and %'s cut in half. Also on edit chart screen you get the same behaviour. I'm really interested in solving this but have literally no idea if the issue is on apache echarts or where else

PS: If this should be on "Bug report" please tell me so I can change

Design input

none

Comment From: Vicinius

It happens both on 2.1.1 and on 3.0.0. The issue here is with horizontal bar chart and horizontal bar chart only. Even on bigger screens and fullscreen, the chart will cut the numbers because It probably does not work well with the (x axis on 2 decimal points, 0.00%)

Comment From: rusackas

This thread is at risk of being closed as stale since it's been nearly six months since the last comment. I assume some facets of this problem are still present in 3.1 or newer, but this might need an update of context. Further investigation and PRs to automatically strip ticks are welcome. The issue with the labels on the right being cut off MIGHT be fixed by now. I'd suggest we keep each Github Issue to a single problem, rather than conflating them :D

Comment From: sfirke

This persists in 4.0.0: Apache Superset Total value labels on horizontal bar chart get truncated on the far right

Comment From: sfirke

And agreed, this should be two issues -- the overlap vs. the truncation on the right. I am going to take the liberty of making this issue about the truncation on the right since that's what I can corroborate. @Vicinius, if you can check that the overlap problem persists in 4.0.0, can you please open a new issue for that and link back to this one?

Comment From: sfirke

This persists in 4.0.2 - here the "M" is getting cut off: Apache Superset Total value labels on horizontal bar chart get truncated on the far right

Comment From: fardin-developer

I would like to work on this

Comment From: shexiaobin

It is possible to attempt to solve the problem by modifying the source code. The solution is as follows: Locate the configuration file, which is superset-4.1.1/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/transformers.ts.

Replace the line "position: isHorizontal ? " with the appropriate code. 'right' : 'top', The position: isHorizontal ? 'inside' : 'top' will do. Just recompile the code.

Image

Image