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

Legend: Placement moves from right to bottom location on resizing embedded panel #73211

Open
Tracked by #68135 ...
matthias882 opened this issue Aug 12, 2023 · 2 comments
Open
Tracked by #68135 ...

Comments

@matthias882
Copy link

What happened?

=> Create a panel with legend and placement of legend on the right side.
-> If you resize this panel on the dashboard everything looks fine

=> But if you embed this panel on a website or open the panel-embed-link in a own browser-window there is a wrong behavior.
-> If you resize the window to a smaller wide, the legend moves from the right side to the bottom

What did you expect to happen?

Legend should stay on the right side on resizing the window

Did this work before?

It worked in previous grafana 9.x
wiht update to grafana 10 the problem occured

How do we reproduce it?

  1. create panel with random data
  2. activate legend, mode "List" or "Table"
  3. Select a random value to display in legend
  4. set legend placement to "Right"
  5. Share Panel -> Embed -> open iframe-url in a seperate browser window
  6. resize the browser-window to a smaller wide

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 10.0.3
OS: Ubuntu (up to date)
Browser: Firefox, Edge

Grafana platform?

A package manager (APT, YUM, BREW, etc.)

Datasource(s)?

no

@JoaoSilvaGrafana
Copy link
Contributor

JoaoSilvaGrafana commented Aug 14, 2023

Hey thanks for raising this! It seems to be related to this PR so I wonder if @grafana/dataviz-squad can help? I'm guessing this might be an expected behaviour? 🙏

@matthias882
Copy link
Author

matthias882 commented Aug 14, 2023

Oh no, it's not a bug it's a feature?😅
All my panels are destroyed and I can do nothing against it. I can't integrate them in a bigger size into my visualization and it's not possible to fix the legend to the right.
For example:
It should look this way (screenshot from Grafana dashboard)
1

But embedded as iFrame in the same Size it looks this way :
2

And there is no way to display a legende with 6 or more values.

other example:
so it should look like (Dashboard):
4

and this way it looks embedded in iFrame:
5
and it's not possible to fix this. :(

In the PR #69045 the switch to the bottom legende is made if the wide of browser window falls below the hard codet breakpoint lg. Thats not really practical. The legend on bottom ist only usefull if the panel is higher than wide. The condition to switch between rigt and bottom should be the relation between hight and wide.
In this case the Problem of the PR would also be solved and there would be no effect to panels like my example.

@nmarrs nmarrs changed the title Grafana 10: Legend placement moves from right to bottom location on resizing embedded panel Legend: Placement moves from right to bottom location on resizing embedded panel Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants