Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problematic rendering behavior; an ellipsis is added to the labels and squares are not centered #322

Closed
ultima-originem opened this issue Oct 4, 2023 · 5 comments · Fixed by #323
Assignees
Labels
type/bug Something isn't working

Comments

@ultima-originem
Copy link

Please consider the following 2 screenshots.
image

image

In the first screenshot the squares are centered in the panel and the top text is readable. The name labels are truncated by an ellipsis though this seems unnecessary given the available space.
In the second screenshot the squares are no longer centered in the panel and the top text is not readable. The name labels are fully visible but too small.

I have not succeeded in finding a combination of settings and panel size that results in proper rendering.

I'm using Polystat 2.1.3 in Grafana version 10.1.2 running on Ubuntu and rendered in Firefox 118.0.1 in Windows 10.

Is this known behavior? Are there workarounds?

@briangann
Copy link
Collaborator

The second row rendering is definitely a bug. it should be aligned/centered to fill the space.
The extra ellipses are also a bug, that should only apply to names that cannot be fully displayed.

The font size issue is the default behavior.

The auto-sizing font setting uses the "longest" name in the list to find a font size that is readable, and it is applied to all polygons, regardless of how short those names are, or up to the ellipses limit, whichever is smaller.

The ellipses occur when the name exceeds the default limit, but should only be displayed where appropriate.

We could make this size the font per polygon, but the result ends up looking odd, as some will have very large fonts and others small fonts. The same applies for animated composites, the metric name that is longest is used to determine the font size.

@briangann briangann added the type/bug Something isn't working label Oct 4, 2023
@briangann briangann self-assigned this Oct 4, 2023
@briangann briangann moved this from 📬 Triage to 📅 Planned in Plugins Platform / Grafana Community Oct 4, 2023
@briangann briangann moved this from 📅 Planned to 🧑‍💻 In development in Plugins Platform / Grafana Community Oct 4, 2023
@briangann
Copy link
Collaborator

briangann commented Oct 4, 2023

In the second screenshot the squares are no longer centered in the panel and the top text is not readable. The name labels are fully visible but too small.

I am able to reproduce it now, no need to share a panel/dashboard.

@ultima-originem
Copy link
Author

ultima-originem commented Oct 5, 2023

@briangann wrote:

> The font size issue is the default behavior.
> 
> The auto-sizing font setting uses the "longest" name in the list to find a font size that is readable, and it is applied to all polygons, regardless of how short those names are, or up to the ellipses limit, whichever is smaller.

I'm using a global alias in this panel. As an experiment I removed the regex and it turns out the font size used - which is too small - is the exact same size as in the original second screenshot. My hypothesis is that the code computes the string length of the original strings before the regex is applied.
image

@briangann briangann mentioned this issue Oct 5, 2023
5 tasks
@github-project-automation github-project-automation bot moved this from 🧑‍💻 In development to 🚀 Shipped in Plugins Platform / Grafana Community Oct 6, 2023
@ultima-originem
Copy link
Author

ultima-originem commented Oct 6, 2023

@briangann Thanks! Problem solved.

image

@briangann
Copy link
Collaborator

great to hear, thanks for confirming it is working!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants