Skip to content

Bar chart labels should truncate instead of expanding

Summary

This MR reverts bar charts dynamic label positioning MR !1199 (merged). The decision is for Bar charts to truncate long labels from overlapping with y-axis name instead of shrinking chart size.

This will be eventually used in bar charts GitLab MR gitlab!27155 (merged).

UX Decision

Grabbing the final comment from UX here gitlab!27155 (comment 310533293)

I agree that displaying the full y-axis label would be great but, that can create a number of knock-on issues that are hard to predict. For instance, in the example shown above, the y-axis labels aren't super long, but even then, the space showing the chart is getting pretty small. These aren't even very long labels. If labels get much longer, the chart won't really be readable at all. So, I think I'd probably prioritize showing as much as we can of the chart over displaying the full y-axis values.

This is a really great point that I overlooked, thank you! 🙌

@dbodicherla Let's go with truncation, especially since Amelia mentioned that's what we already do for the other charts.

Screenshots

Before After
image image
Edited by 🤖 GitLab Bot 🤖

Merge request reports